From xen-changelog-bounces@lists.xen.org Wed May 01 06:33:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQbJ-0005sj-0F; Wed, 01 May 2013 06:33: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 1UXQbH-0005sb-8F
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:11 +0000
Received: from [85.158.139.211:15763] by server-9.bemta-5.messagelabs.com id
	A0/A8-14875-527B0815; Wed, 01 May 2013 06:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1367389987!19687003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23509 invoked from network); 1 May 2013 06:33:08 -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;
	1 May 2013 06:33: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 1UXQbB-0004oz-IF
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQb9-0003qi-DV
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:03 +0000
Date: Wed, 01 May 2013 06:33:03 +0000
Message-Id: <E1UXQb9-0003qi-DV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: fix printf format string for
	strlen result
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4492529283277778600=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b3f685edb7b8d040182b9e4d83bf34f2883cc385
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Apr 30 09:08:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 30 09:08:08 2013 +0200

    xsm: fix printf format string for strlen result
    
    strlen returns size_t:
    
    policydb.c: In function policydb_read:
    policydb.c:1779: error: format %lu expects type long unsigned int, but argument 3 has type size_t
    
    This is probably benign on 64-bit x86 but was found by Dharshini on 32-bit Xen
    4.2.x. I expect it affects ARM too.
    
    Reported-by: Dharshini Tharmaraj <dharshinitharmaraj@gmail.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/xsm/flask/ss/policydb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index fefcd59..bdec4ac 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1737,7 +1737,7 @@ int policydb_read(struct policydb *p, void *fp)
     if ( len != strlen(POLICYDB_STRING) )
     {
         printk(KERN_ERR "Flask:  policydb string length %d does not "
-               "match expected length %lu\n",
+               "match expected length %zu\n",
                len, strlen(POLICYDB_STRING));
         goto bad;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4492529283277778600==
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
--===============4492529283277778600==--

From xen-changelog-bounces@lists.xen.org Wed May 01 06:33:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQbJ-0005sj-0F; Wed, 01 May 2013 06:33: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 1UXQbH-0005sb-8F
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:11 +0000
Received: from [85.158.139.211:15763] by server-9.bemta-5.messagelabs.com id
	A0/A8-14875-527B0815; Wed, 01 May 2013 06:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1367389987!19687003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23509 invoked from network); 1 May 2013 06:33:08 -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;
	1 May 2013 06:33: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 1UXQbB-0004oz-IF
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQb9-0003qi-DV
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:03 +0000
Date: Wed, 01 May 2013 06:33:03 +0000
Message-Id: <E1UXQb9-0003qi-DV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: fix printf format string for
	strlen result
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4492529283277778600=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b3f685edb7b8d040182b9e4d83bf34f2883cc385
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Apr 30 09:08:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 30 09:08:08 2013 +0200

    xsm: fix printf format string for strlen result
    
    strlen returns size_t:
    
    policydb.c: In function policydb_read:
    policydb.c:1779: error: format %lu expects type long unsigned int, but argument 3 has type size_t
    
    This is probably benign on 64-bit x86 but was found by Dharshini on 32-bit Xen
    4.2.x. I expect it affects ARM too.
    
    Reported-by: Dharshini Tharmaraj <dharshinitharmaraj@gmail.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/xsm/flask/ss/policydb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index fefcd59..bdec4ac 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1737,7 +1737,7 @@ int policydb_read(struct policydb *p, void *fp)
     if ( len != strlen(POLICYDB_STRING) )
     {
         printk(KERN_ERR "Flask:  policydb string length %d does not "
-               "match expected length %lu\n",
+               "match expected length %zu\n",
                len, strlen(POLICYDB_STRING));
         goto bad;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4492529283277778600==
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
--===============4492529283277778600==--

From xen-changelog-bounces@lists.xen.org Wed May 01 06:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQbY-0005ta-3N; Wed, 01 May 2013 06:33:28 +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 1UXQbW-0005tO-Pz
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:27 +0000
Received: from [85.158.137.99:52575] by server-14.bemta-3.messagelabs.com id
	3D/34-27076-037B0815; Wed, 01 May 2013 06:33:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1367389997!16632310!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11098 invoked from network); 1 May 2013 06:33:19 -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;
	1 May 2013 06:33: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 1UXQbN-0004p2-Hf
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbL-0003rD-Np
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:15 +0000
Date: Wed, 01 May 2013 06:33:15 +0000
Message-Id: <E1UXQbL-0003rD-Np@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: correct the computation of
	the number of interrupt lines for the GIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2f2a3e317df8f6ce73a13ae6a16361da07e703f6
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Apr 29 14:25:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:25:40 2013 +0100

    xen/arm: correct the computation of the number of interrupt lines for the GIC
    
    In the GIC manual, the number of interrupt lines is computed with the
    following formula: 32(N + 1) where N is the value retrieved from GICD_TYPER.
    
    Without the +1 Xen doesn't initialize the last 32 interrupts and can get
    garbage on these registers.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8e591fa..afc9405 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -44,7 +44,7 @@ static struct {
     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 lines;  /* Number of interrupts (SPIs + PPIs + SGIs) */
     unsigned int cpus;
     spinlock_t lock;
 } gic;
@@ -214,7 +214,7 @@ static int gic_route_irq(unsigned int irq, bool_t level,
 
     ASSERT(!(cpu_mask & ~0xff));  /* Targets bitmap only supports 8 CPUs */
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
-    ASSERT(irq < gic.lines + 32); /* Can't route interrupts that don't exist */
+    ASSERT(irq < gic.lines);      /* Can't route interrupts that don't exist */
 
     spin_lock_irqsave(&desc->lock, flags);
     spin_lock(&gic.lock);
@@ -251,7 +251,7 @@ static void __init gic_dist_init(void)
     GICD[GICD_CTLR] = 0;
 
     type = GICD[GICD_TYPER];
-    gic.lines = 32 * (type & GICD_TYPE_LINES);
+    gic.lines = 32 * ((type & GICD_TYPE_LINES) + 1);
     gic.cpus = 1 + ((type & GICD_TYPE_CPUS) >> 5);
     printk("GIC: %d lines, %d cpu%s%s (IID %8.8x).\n",
            gic.lines, gic.cpus, (gic.cpus == 1) ? "" : "s",
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQbY-0005ta-3N; Wed, 01 May 2013 06:33:28 +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 1UXQbW-0005tO-Pz
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:27 +0000
Received: from [85.158.137.99:52575] by server-14.bemta-3.messagelabs.com id
	3D/34-27076-037B0815; Wed, 01 May 2013 06:33:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1367389997!16632310!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11098 invoked from network); 1 May 2013 06:33:19 -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;
	1 May 2013 06:33: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 1UXQbN-0004p2-Hf
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbL-0003rD-Np
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:15 +0000
Date: Wed, 01 May 2013 06:33:15 +0000
Message-Id: <E1UXQbL-0003rD-Np@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: correct the computation of
	the number of interrupt lines for the GIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2f2a3e317df8f6ce73a13ae6a16361da07e703f6
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Apr 29 14:25:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:25:40 2013 +0100

    xen/arm: correct the computation of the number of interrupt lines for the GIC
    
    In the GIC manual, the number of interrupt lines is computed with the
    following formula: 32(N + 1) where N is the value retrieved from GICD_TYPER.
    
    Without the +1 Xen doesn't initialize the last 32 interrupts and can get
    garbage on these registers.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8e591fa..afc9405 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -44,7 +44,7 @@ static struct {
     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 lines;  /* Number of interrupts (SPIs + PPIs + SGIs) */
     unsigned int cpus;
     spinlock_t lock;
 } gic;
@@ -214,7 +214,7 @@ static int gic_route_irq(unsigned int irq, bool_t level,
 
     ASSERT(!(cpu_mask & ~0xff));  /* Targets bitmap only supports 8 CPUs */
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
-    ASSERT(irq < gic.lines + 32); /* Can't route interrupts that don't exist */
+    ASSERT(irq < gic.lines);      /* Can't route interrupts that don't exist */
 
     spin_lock_irqsave(&desc->lock, flags);
     spin_lock(&gic.lock);
@@ -251,7 +251,7 @@ static void __init gic_dist_init(void)
     GICD[GICD_CTLR] = 0;
 
     type = GICD[GICD_TYPER];
-    gic.lines = 32 * (type & GICD_TYPE_LINES);
+    gic.lines = 32 * ((type & GICD_TYPE_LINES) + 1);
     gic.cpus = 1 + ((type & GICD_TYPE_CPUS) >> 5);
     printk("GIC: %d lines, %d cpu%s%s (IID %8.8x).\n",
            gic.lines, gic.cpus, (gic.cpus == 1) ? "" : "s",
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:33:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQbd-0005u0-63; Wed, 01 May 2013 06:33:33 +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 1UXQbb-0005tn-91
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:31 +0000
Received: from [85.158.139.83:14486] by server-3.bemta-5.messagelabs.com id
	94/48-31108-A37B0815; Wed, 01 May 2013 06:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1367390008!26797764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8472 invoked from network); 1 May 2013 06:33: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;
	1 May 2013 06:33: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 1UXQbY-0004p8-Lr
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbX-0003sU-LL
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:27 +0000
Date: Wed, 01 May 2013 06:33:27 +0000
Message-Id: <E1UXQbX-0003sU-LL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix spelling of "backend-id"
	for vtpm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 49cdb736976df6db398d177368527581c106dc5f
Author:     Marek Marczykowski <marmarek@invisiblethingslab.com>
AuthorDate: Sun Apr 28 01:17:52 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:27:54 2013 +0100

    libxl: fix spelling of "backend-id" for vtpm
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 30302c7..ea8281d 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1855,7 +1855,7 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n
           vtpm->devid = atoi(*dir);
 
           tmp = libxl__xs_read(gc, XBT_NULL,
-                GCSPRINTF("%s/%s/backend_id",
+                GCSPRINTF("%s/%s/backend-id",
                    fe_path, *dir));
           vtpm->backend_domid = atoi(tmp);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:33:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQbd-0005u0-63; Wed, 01 May 2013 06:33:33 +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 1UXQbb-0005tn-91
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:31 +0000
Received: from [85.158.139.83:14486] by server-3.bemta-5.messagelabs.com id
	94/48-31108-A37B0815; Wed, 01 May 2013 06:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1367390008!26797764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8472 invoked from network); 1 May 2013 06:33: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;
	1 May 2013 06:33: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 1UXQbY-0004p8-Lr
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbX-0003sU-LL
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:27 +0000
Date: Wed, 01 May 2013 06:33:27 +0000
Message-Id: <E1UXQbX-0003sU-LL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix spelling of "backend-id"
	for vtpm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 49cdb736976df6db398d177368527581c106dc5f
Author:     Marek Marczykowski <marmarek@invisiblethingslab.com>
AuthorDate: Sun Apr 28 01:17:52 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:27:54 2013 +0100

    libxl: fix spelling of "backend-id" for vtpm
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 30302c7..ea8281d 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1855,7 +1855,7 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n
           vtpm->devid = atoi(*dir);
 
           tmp = libxl__xs_read(gc, XBT_NULL,
-                GCSPRINTF("%s/%s/backend_id",
+                GCSPRINTF("%s/%s/backend-id",
                    fe_path, *dir));
           vtpm->backend_domid = atoi(tmp);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:34:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQc2-0005x3-9v; Wed, 01 May 2013 06:33:58 +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 1UXQc0-0005wi-Fs
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:56 +0000
Received: from [85.158.138.51:16078] by server-9.bemta-3.messagelabs.com id
	94/F5-32531-257B0815; Wed, 01 May 2013 06:33:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1367390029!27816727!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17381 invoked from network); 1 May 2013 06:33:51 -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;
	1 May 2013 06:33: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 1UXQbt-0004pM-Bx
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbt-0003tG-5c
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:49 +0000
Date: Wed, 01 May 2013 06:33:49 +0000
Message-Id: <E1UXQbt-0003tG-5c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: move the tlb_flush in
	create_p2m_entries to the end of the 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

commit 11d8866da50a75ef5089faebdfa37164bdcb7545
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Apr 29 18:04:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:31:33 2013 +0100

    xen/arm: move the tlb_flush in create_p2m_entries to the end of the function
    
    Move the flush after the pagetable entry has actually been written to
    avoid races with other vcpus refreshing the same entriy.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1e8c8b4..9fc5534 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -133,7 +133,7 @@ static int create_p2m_entries(struct domain *d,
                      paddr_t maddr,
                      int mattr)
 {
-    int rc;
+    int rc, flush;
     struct p2m_domain *p2m = &d->arch.p2m;
     lpae_t *first = NULL, *second = NULL, *third = NULL;
     paddr_t addr;
@@ -186,10 +186,8 @@ static int create_p2m_entries(struct domain *d,
             third = map_domain_page(second[second_table_offset(addr)].p2m.base);
             cur_second_offset = second_table_offset(addr);
         }
-        /* else: third already valid */
 
-        if ( third[third_table_offset(addr)].p2m.valid )
-            flush_tlb_all_local();
+        flush = third[third_table_offset(addr)].p2m.valid;
 
         /* Allocate a new RAM page and attach */
         switch (op) {
@@ -226,6 +224,9 @@ static int create_p2m_entries(struct domain *d,
                 }
                 break;
         }
+
+        if ( flush )
+            flush_tlb_all_local();
     }
 
     rc = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:34:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06: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 1UXQc2-0005x3-9v; Wed, 01 May 2013 06:33:58 +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 1UXQc0-0005wi-Fs
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:56 +0000
Received: from [85.158.138.51:16078] by server-9.bemta-3.messagelabs.com id
	94/F5-32531-257B0815; Wed, 01 May 2013 06:33:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1367390029!27816727!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17381 invoked from network); 1 May 2013 06:33:51 -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;
	1 May 2013 06:33: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 1UXQbt-0004pM-Bx
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbt-0003tG-5c
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:49 +0000
Date: Wed, 01 May 2013 06:33:49 +0000
Message-Id: <E1UXQbt-0003tG-5c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: move the tlb_flush in
	create_p2m_entries to the end of the 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

commit 11d8866da50a75ef5089faebdfa37164bdcb7545
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Apr 29 18:04:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:31:33 2013 +0100

    xen/arm: move the tlb_flush in create_p2m_entries to the end of the function
    
    Move the flush after the pagetable entry has actually been written to
    avoid races with other vcpus refreshing the same entriy.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1e8c8b4..9fc5534 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -133,7 +133,7 @@ static int create_p2m_entries(struct domain *d,
                      paddr_t maddr,
                      int mattr)
 {
-    int rc;
+    int rc, flush;
     struct p2m_domain *p2m = &d->arch.p2m;
     lpae_t *first = NULL, *second = NULL, *third = NULL;
     paddr_t addr;
@@ -186,10 +186,8 @@ static int create_p2m_entries(struct domain *d,
             third = map_domain_page(second[second_table_offset(addr)].p2m.base);
             cur_second_offset = second_table_offset(addr);
         }
-        /* else: third already valid */
 
-        if ( third[third_table_offset(addr)].p2m.valid )
-            flush_tlb_all_local();
+        flush = third[third_table_offset(addr)].p2m.valid;
 
         /* Allocate a new RAM page and attach */
         switch (op) {
@@ -226,6 +224,9 @@ static int create_p2m_entries(struct domain *d,
                 }
                 break;
         }
+
+        if ( flush )
+            flush_tlb_all_local();
     }
 
     rc = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:34:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:34: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 1UXQcb-00060T-Ia; Wed, 01 May 2013 06:34: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 1UXQca-000604-PJ
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:32 +0000
Received: from [193.109.254.147:59533] by server-8.bemta-14.messagelabs.com id
	CA/89-07222-877B0815; Wed, 01 May 2013 06:34:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1367390019!3204261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12400 invoked from network); 1 May 2013 06:33:40 -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;
	1 May 2013 06:33: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 1UXQbj-0004pD-1Q
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbi-0003su-Pj
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:39 +0000
Date: Wed, 01 May 2013 06:33:38 +0000
Message-Id: <E1UXQbi-0003su-Pj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: do not call __cpu_disable on
	machine_halt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b4aae03ce525e8e2364814d0fed8f982aefc4958
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Apr 29 18:04:25 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:31:27 2013 +0100

    xen/arm: do not call __cpu_disable on machine_halt
    
    __cpu_disable shouldn't be called on machine_halt, in fact it cannot
    succeed: cpu_disable_scheduler won't be able to migrate away vcpus to
    others pcpus.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/shutdown.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index c1b60af..61b5280 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -25,7 +25,6 @@ static void raw_machine_reset(void)
 
 static void halt_this_cpu(void *arg)
 {
-    __cpu_disable();
     stop_cpu();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:34:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:34: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 1UXQcb-00060T-Ia; Wed, 01 May 2013 06:34: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 1UXQca-000604-PJ
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:32 +0000
Received: from [193.109.254.147:59533] by server-8.bemta-14.messagelabs.com id
	CA/89-07222-877B0815; Wed, 01 May 2013 06:34:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1367390019!3204261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12400 invoked from network); 1 May 2013 06:33:40 -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;
	1 May 2013 06:33: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 1UXQbj-0004pD-1Q
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQbi-0003su-Pj
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:39 +0000
Date: Wed, 01 May 2013 06:33:38 +0000
Message-Id: <E1UXQbi-0003su-Pj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: do not call __cpu_disable on
	machine_halt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b4aae03ce525e8e2364814d0fed8f982aefc4958
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Apr 29 18:04:25 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:31:27 2013 +0100

    xen/arm: do not call __cpu_disable on machine_halt
    
    __cpu_disable shouldn't be called on machine_halt, in fact it cannot
    succeed: cpu_disable_scheduler won't be able to migrate away vcpus to
    others pcpus.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/shutdown.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index c1b60af..61b5280 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -25,7 +25,6 @@ static void raw_machine_reset(void)
 
 static void halt_this_cpu(void *arg)
 {
-    __cpu_disable();
     stop_cpu();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:34:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:34: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 1UXQca-000605-E6; Wed, 01 May 2013 06:34: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 1UXQcY-0005zs-Hx
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:30 +0000
Received: from [85.158.138.51:17600] by server-15.bemta-3.messagelabs.com id
	D0/D9-23142-577B0815; Wed, 01 May 2013 06:34:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1367390049!21153599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4575 invoked from network); 1 May 2013 06:34:10 -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;
	1 May 2013 06:34: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 1UXQcD-0004q1-N8
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQcD-0003u1-Ka
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:09 +0000
Date: Wed, 01 May 2013 06:34:09 +0000
Message-Id: <E1UXQcD-0003u1-Ka@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] More emacs local variable block fixes.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dea0a7c81ea948567308d2a9f1f9ef51a94cefa9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 17:20:39 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:42:57 2013 +0100

    More emacs local variable block fixes.
    
    The emacs variable to set the C style from a local variable block is
    c-file-style, not c-set-style.
    
    These were either missed by 82639998a5f2 or have crept back in since.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/arm32/domain.c           |    2 +-
 xen/arch/arm/arm32/traps.c            |    2 +-
 xen/arch/arm/arm64/asm-offsets.c      |    2 +-
 xen/arch/arm/arm64/domain.c           |    2 +-
 xen/arch/arm/arm64/traps.c            |    2 +-
 xen/arch/arm/cpu.c                    |    2 +-
 xen/common/gcov/gcov.c                |    2 +-
 xen/include/asm-arm/arm32/atomic.h    |    2 +-
 xen/include/asm-arm/arm32/flushtlb.h  |    2 +-
 xen/include/asm-arm/arm32/page.h      |    2 +-
 xen/include/asm-arm/arm32/processor.h |    2 +-
 xen/include/asm-arm/arm32/spinlock.h  |    2 +-
 xen/include/asm-arm/arm32/system.h    |    2 +-
 xen/include/asm-arm/arm64/atomic.h    |    2 +-
 xen/include/asm-arm/arm64/bitops.h    |    2 +-
 xen/include/asm-arm/arm64/flushtlb.h  |    2 +-
 xen/include/asm-arm/arm64/page.h      |    2 +-
 xen/include/asm-arm/arm64/processor.h |    2 +-
 xen/include/asm-arm/arm64/spinlock.h  |    2 +-
 xen/include/asm-arm/arm64/system.h    |    2 +-
 xen/include/asm-arm/cpufeature.h      |    2 +-
 21 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/arm32/domain.c b/xen/arch/arm/arm32/domain.c
index f75a2c6..f357db4 100644
--- a/xen/arch/arm/arm32/domain.c
+++ b/xen/arch/arm/arm32/domain.c
@@ -44,7 +44,7 @@ void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm32/traps.c b/xen/arch/arm/arm32/traps.c
index a93c2f7..ff0b945 100644
--- a/xen/arch/arm/arm32/traps.c
+++ b/xen/arch/arm/arm32/traps.c
@@ -46,7 +46,7 @@ asmlinkage void do_trap_data_abort(struct cpu_user_regs *regs)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm64/asm-offsets.c b/xen/arch/arm/arm64/asm-offsets.c
index 7949e3e..7aacc79 100644
--- a/xen/arch/arm/arm64/asm-offsets.c
+++ b/xen/arch/arm/arm64/asm-offsets.c
@@ -51,7 +51,7 @@ void __dummy__(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm64/domain.c b/xen/arch/arm/arm64/domain.c
index 05df29e..6990a7b 100644
--- a/xen/arch/arm/arm64/domain.c
+++ b/xen/arch/arm/arm64/domain.c
@@ -59,7 +59,7 @@ void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm64/traps.c b/xen/arch/arm/arm64/traps.c
index 02ef992..d778f89 100644
--- a/xen/arch/arm/arm64/traps.c
+++ b/xen/arch/arm/arm64/traps.c
@@ -49,7 +49,7 @@ asmlinkage void do_bad_mode(struct cpu_user_regs *regs, int reason)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/cpu.c b/xen/arch/arm/cpu.c
index 7a8ad33..afc564f 100644
--- a/xen/arch/arm/cpu.c
+++ b/xen/arch/arm/cpu.c
@@ -62,7 +62,7 @@ void __cpuinit identify_cpu(struct cpuinfo_arm *c)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/common/gcov/gcov.c b/xen/common/gcov/gcov.c
index 01d5b10..b5717b9 100644
--- a/xen/common/gcov/gcov.c
+++ b/xen/common/gcov/gcov.c
@@ -217,7 +217,7 @@ int sysctl_coverage_op(xen_sysctl_coverage_op_t *op)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * tab-width: 4
  * indent-tabs-mode: nil
diff --git a/xen/include/asm-arm/arm32/atomic.h b/xen/include/asm-arm/arm32/atomic.h
index 4ee6626..523c745 100644
--- a/xen/include/asm-arm/arm32/atomic.h
+++ b/xen/include/asm-arm/arm32/atomic.h
@@ -144,7 +144,7 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/flushtlb.h b/xen/include/asm-arm/arm32/flushtlb.h
index e6dabd4..a258f58 100644
--- a/xen/include/asm-arm/arm32/flushtlb.h
+++ b/xen/include/asm-arm/arm32/flushtlb.h
@@ -27,7 +27,7 @@ static inline void flush_tlb_all_local(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index d295316..38bcffd 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -118,7 +118,7 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * tab-width: 4
  * indent-tabs-mode: nil
diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h
index a782d96..cd79170 100644
--- a/xen/include/asm-arm/arm32/processor.h
+++ b/xen/include/asm-arm/arm32/processor.h
@@ -113,7 +113,7 @@ struct cpu_user_regs
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/spinlock.h b/xen/include/asm-arm/arm32/spinlock.h
index a7bcdbf..4a11a97 100644
--- a/xen/include/asm-arm/arm32/spinlock.h
+++ b/xen/include/asm-arm/arm32/spinlock.h
@@ -134,7 +134,7 @@ static inline void _raw_write_unlock(raw_rwlock_t *rw)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/system.h b/xen/include/asm-arm/arm32/system.h
index f28879d..60148cb 100644
--- a/xen/include/asm-arm/arm32/system.h
+++ b/xen/include/asm-arm/arm32/system.h
@@ -181,7 +181,7 @@ static inline int local_fiq_is_enabled(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/atomic.h b/xen/include/asm-arm/arm64/atomic.h
index 972d50c..5e4ffed 100644
--- a/xen/include/asm-arm/arm64/atomic.h
+++ b/xen/include/asm-arm/arm64/atomic.h
@@ -156,7 +156,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/bitops.h b/xen/include/asm-arm/arm64/bitops.h
index 847d65c..0a6eba3 100644
--- a/xen/include/asm-arm/arm64/bitops.h
+++ b/xen/include/asm-arm/arm64/bitops.h
@@ -276,7 +276,7 @@ extern unsigned long find_first_zero_bit(const unsigned long *addr,
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/flushtlb.h b/xen/include/asm-arm/arm64/flushtlb.h
index ca74fe3..d0535a0 100644
--- a/xen/include/asm-arm/arm64/flushtlb.h
+++ b/xen/include/asm-arm/arm64/flushtlb.h
@@ -27,7 +27,7 @@ static inline void flush_tlb_all_local(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 9bf41fb..bd48fe3 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -112,7 +112,7 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * tab-width: 4
  * indent-tabs-mode: nil
diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h
index b4602fa..d9fbcb2 100644
--- a/xen/include/asm-arm/arm64/processor.h
+++ b/xen/include/asm-arm/arm64/processor.h
@@ -111,7 +111,7 @@ struct cpu_user_regs
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/spinlock.h b/xen/include/asm-arm/arm64/spinlock.h
index 52ad688..fe4c403 100644
--- a/xen/include/asm-arm/arm64/spinlock.h
+++ b/xen/include/asm-arm/arm64/spinlock.h
@@ -118,7 +118,7 @@ static inline void _raw_write_unlock(raw_rwlock_t *rw)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/system.h b/xen/include/asm-arm/arm64/system.h
index daa221e..4e41913 100644
--- a/xen/include/asm-arm/arm64/system.h
+++ b/xen/include/asm-arm/arm64/system.h
@@ -231,7 +231,7 @@ static inline int local_fiq_is_enabled(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index e633239..1d2c9c7 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -33,7 +33,7 @@
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:34:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:34: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 1UXQca-000605-E6; Wed, 01 May 2013 06:34: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 1UXQcY-0005zs-Hx
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:30 +0000
Received: from [85.158.138.51:17600] by server-15.bemta-3.messagelabs.com id
	D0/D9-23142-577B0815; Wed, 01 May 2013 06:34:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1367390049!21153599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4575 invoked from network); 1 May 2013 06:34:10 -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;
	1 May 2013 06:34: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 1UXQcD-0004q1-N8
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQcD-0003u1-Ka
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:09 +0000
Date: Wed, 01 May 2013 06:34:09 +0000
Message-Id: <E1UXQcD-0003u1-Ka@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] More emacs local variable block fixes.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dea0a7c81ea948567308d2a9f1f9ef51a94cefa9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 17:20:39 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:42:57 2013 +0100

    More emacs local variable block fixes.
    
    The emacs variable to set the C style from a local variable block is
    c-file-style, not c-set-style.
    
    These were either missed by 82639998a5f2 or have crept back in since.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/arm32/domain.c           |    2 +-
 xen/arch/arm/arm32/traps.c            |    2 +-
 xen/arch/arm/arm64/asm-offsets.c      |    2 +-
 xen/arch/arm/arm64/domain.c           |    2 +-
 xen/arch/arm/arm64/traps.c            |    2 +-
 xen/arch/arm/cpu.c                    |    2 +-
 xen/common/gcov/gcov.c                |    2 +-
 xen/include/asm-arm/arm32/atomic.h    |    2 +-
 xen/include/asm-arm/arm32/flushtlb.h  |    2 +-
 xen/include/asm-arm/arm32/page.h      |    2 +-
 xen/include/asm-arm/arm32/processor.h |    2 +-
 xen/include/asm-arm/arm32/spinlock.h  |    2 +-
 xen/include/asm-arm/arm32/system.h    |    2 +-
 xen/include/asm-arm/arm64/atomic.h    |    2 +-
 xen/include/asm-arm/arm64/bitops.h    |    2 +-
 xen/include/asm-arm/arm64/flushtlb.h  |    2 +-
 xen/include/asm-arm/arm64/page.h      |    2 +-
 xen/include/asm-arm/arm64/processor.h |    2 +-
 xen/include/asm-arm/arm64/spinlock.h  |    2 +-
 xen/include/asm-arm/arm64/system.h    |    2 +-
 xen/include/asm-arm/cpufeature.h      |    2 +-
 21 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/arm32/domain.c b/xen/arch/arm/arm32/domain.c
index f75a2c6..f357db4 100644
--- a/xen/arch/arm/arm32/domain.c
+++ b/xen/arch/arm/arm32/domain.c
@@ -44,7 +44,7 @@ void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm32/traps.c b/xen/arch/arm/arm32/traps.c
index a93c2f7..ff0b945 100644
--- a/xen/arch/arm/arm32/traps.c
+++ b/xen/arch/arm/arm32/traps.c
@@ -46,7 +46,7 @@ asmlinkage void do_trap_data_abort(struct cpu_user_regs *regs)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm64/asm-offsets.c b/xen/arch/arm/arm64/asm-offsets.c
index 7949e3e..7aacc79 100644
--- a/xen/arch/arm/arm64/asm-offsets.c
+++ b/xen/arch/arm/arm64/asm-offsets.c
@@ -51,7 +51,7 @@ void __dummy__(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm64/domain.c b/xen/arch/arm/arm64/domain.c
index 05df29e..6990a7b 100644
--- a/xen/arch/arm/arm64/domain.c
+++ b/xen/arch/arm/arm64/domain.c
@@ -59,7 +59,7 @@ void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/arm64/traps.c b/xen/arch/arm/arm64/traps.c
index 02ef992..d778f89 100644
--- a/xen/arch/arm/arm64/traps.c
+++ b/xen/arch/arm/arm64/traps.c
@@ -49,7 +49,7 @@ asmlinkage void do_bad_mode(struct cpu_user_regs *regs, int reason)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/arch/arm/cpu.c b/xen/arch/arm/cpu.c
index 7a8ad33..afc564f 100644
--- a/xen/arch/arm/cpu.c
+++ b/xen/arch/arm/cpu.c
@@ -62,7 +62,7 @@ void __cpuinit identify_cpu(struct cpuinfo_arm *c)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/common/gcov/gcov.c b/xen/common/gcov/gcov.c
index 01d5b10..b5717b9 100644
--- a/xen/common/gcov/gcov.c
+++ b/xen/common/gcov/gcov.c
@@ -217,7 +217,7 @@ int sysctl_coverage_op(xen_sysctl_coverage_op_t *op)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * tab-width: 4
  * indent-tabs-mode: nil
diff --git a/xen/include/asm-arm/arm32/atomic.h b/xen/include/asm-arm/arm32/atomic.h
index 4ee6626..523c745 100644
--- a/xen/include/asm-arm/arm32/atomic.h
+++ b/xen/include/asm-arm/arm32/atomic.h
@@ -144,7 +144,7 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/flushtlb.h b/xen/include/asm-arm/arm32/flushtlb.h
index e6dabd4..a258f58 100644
--- a/xen/include/asm-arm/arm32/flushtlb.h
+++ b/xen/include/asm-arm/arm32/flushtlb.h
@@ -27,7 +27,7 @@ static inline void flush_tlb_all_local(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index d295316..38bcffd 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -118,7 +118,7 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * tab-width: 4
  * indent-tabs-mode: nil
diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h
index a782d96..cd79170 100644
--- a/xen/include/asm-arm/arm32/processor.h
+++ b/xen/include/asm-arm/arm32/processor.h
@@ -113,7 +113,7 @@ struct cpu_user_regs
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/spinlock.h b/xen/include/asm-arm/arm32/spinlock.h
index a7bcdbf..4a11a97 100644
--- a/xen/include/asm-arm/arm32/spinlock.h
+++ b/xen/include/asm-arm/arm32/spinlock.h
@@ -134,7 +134,7 @@ static inline void _raw_write_unlock(raw_rwlock_t *rw)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm32/system.h b/xen/include/asm-arm/arm32/system.h
index f28879d..60148cb 100644
--- a/xen/include/asm-arm/arm32/system.h
+++ b/xen/include/asm-arm/arm32/system.h
@@ -181,7 +181,7 @@ static inline int local_fiq_is_enabled(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/atomic.h b/xen/include/asm-arm/arm64/atomic.h
index 972d50c..5e4ffed 100644
--- a/xen/include/asm-arm/arm64/atomic.h
+++ b/xen/include/asm-arm/arm64/atomic.h
@@ -156,7 +156,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/bitops.h b/xen/include/asm-arm/arm64/bitops.h
index 847d65c..0a6eba3 100644
--- a/xen/include/asm-arm/arm64/bitops.h
+++ b/xen/include/asm-arm/arm64/bitops.h
@@ -276,7 +276,7 @@ extern unsigned long find_first_zero_bit(const unsigned long *addr,
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/flushtlb.h b/xen/include/asm-arm/arm64/flushtlb.h
index ca74fe3..d0535a0 100644
--- a/xen/include/asm-arm/arm64/flushtlb.h
+++ b/xen/include/asm-arm/arm64/flushtlb.h
@@ -27,7 +27,7 @@ static inline void flush_tlb_all_local(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 9bf41fb..bd48fe3 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -112,7 +112,7 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * tab-width: 4
  * indent-tabs-mode: nil
diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h
index b4602fa..d9fbcb2 100644
--- a/xen/include/asm-arm/arm64/processor.h
+++ b/xen/include/asm-arm/arm64/processor.h
@@ -111,7 +111,7 @@ struct cpu_user_regs
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/spinlock.h b/xen/include/asm-arm/arm64/spinlock.h
index 52ad688..fe4c403 100644
--- a/xen/include/asm-arm/arm64/spinlock.h
+++ b/xen/include/asm-arm/arm64/spinlock.h
@@ -118,7 +118,7 @@ static inline void _raw_write_unlock(raw_rwlock_t *rw)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/arm64/system.h b/xen/include/asm-arm/arm64/system.h
index daa221e..4e41913 100644
--- a/xen/include/asm-arm/arm64/system.h
+++ b/xen/include/asm-arm/arm64/system.h
@@ -231,7 +231,7 @@ static inline int local_fiq_is_enabled(void)
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index e633239..1d2c9c7 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -33,7 +33,7 @@
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * c-file-style: "BSD"
  * c-basic-offset: 4
  * indent-tabs-mode: nil
  * End:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:35:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:35: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 1UXQdX-00065D-N1; Wed, 01 May 2013 06:35: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 1UXQdW-000658-Qz
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:35:31 +0000
Received: from [193.109.254.147:46698] by server-11.bemta-14.messagelabs.com
	id A8/00-24840-2B7B0815; Wed, 01 May 2013 06:35:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1367390039!8860456!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6168 invoked from network); 1 May 2013 06:34:01 -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;
	1 May 2013 06:34: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 1UXQc3-0004pS-Hi
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQc3-0003tc-FW
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:59 +0000
Date: Wed, 01 May 2013 06:33:59 +0000
Message-Id: <E1UXQc3-0003tc-FW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: introduce vcpu_block
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7be7b15dde4364b6f524aa9330a283c60b7708ea
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Apr 23 12:19:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:32:04 2013 +0100

    xen: introduce vcpu_block
    
    Rename do_block to vcpu_block.
    
    Move the call to local_event_delivery_enable out of vcpu_block, to a new
    static function called vcpu_block_enable_events.
    
    Use vcpu_block_enable_events instead of do_block throughout in
    schedule.c
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/schedule.c   |   13 ++++++++-----
 xen/include/xen/sched.h |    1 +
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c1cd3d0..e526602 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -677,11 +677,10 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 }
 
 /* Block the currently-executing domain until a pertinent event occurs. */
-static long do_block(void)
+void vcpu_block(void)
 {
     struct vcpu *v = current;
 
-    local_event_delivery_enable();
     set_bit(_VPF_blocked, &v->pause_flags);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
@@ -694,8 +693,12 @@ static long do_block(void)
         TRACE_2D(TRC_SCHED_BLOCK, v->domain->domain_id, v->vcpu_id);
         raise_softirq(SCHEDULE_SOFTIRQ);
     }
+}
 
-    return 0;
+static void vcpu_block_enable_events(void)
+{
+    local_event_delivery_enable();
+    vcpu_block();
 }
 
 static long do_poll(struct sched_poll *sched_poll)
@@ -870,7 +873,7 @@ long do_sched_op_compat(int cmd, unsigned long arg)
 
     case SCHEDOP_block:
     {
-        ret = do_block();
+        vcpu_block_enable_events();
         break;
     }
 
@@ -907,7 +910,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case SCHEDOP_block:
     {
-        ret = do_block();
+        vcpu_block_enable_events();
         break;
     }
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ad971d2..beadc42 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -690,6 +690,7 @@ static inline int vcpu_runnable(struct vcpu *v)
              atomic_read(&v->domain->pause_count));
 }
 
+void vcpu_block(void);
 void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:35:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:35: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 1UXQdX-00065D-N1; Wed, 01 May 2013 06:35: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 1UXQdW-000658-Qz
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:35:31 +0000
Received: from [193.109.254.147:46698] by server-11.bemta-14.messagelabs.com
	id A8/00-24840-2B7B0815; Wed, 01 May 2013 06:35:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1367390039!8860456!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6168 invoked from network); 1 May 2013 06:34:01 -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;
	1 May 2013 06:34: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 1UXQc3-0004pS-Hi
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQc3-0003tc-FW
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:33:59 +0000
Date: Wed, 01 May 2013 06:33:59 +0000
Message-Id: <E1UXQc3-0003tc-FW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: introduce vcpu_block
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7be7b15dde4364b6f524aa9330a283c60b7708ea
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Apr 23 12:19:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:32:04 2013 +0100

    xen: introduce vcpu_block
    
    Rename do_block to vcpu_block.
    
    Move the call to local_event_delivery_enable out of vcpu_block, to a new
    static function called vcpu_block_enable_events.
    
    Use vcpu_block_enable_events instead of do_block throughout in
    schedule.c
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/schedule.c   |   13 ++++++++-----
 xen/include/xen/sched.h |    1 +
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c1cd3d0..e526602 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -677,11 +677,10 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 }
 
 /* Block the currently-executing domain until a pertinent event occurs. */
-static long do_block(void)
+void vcpu_block(void)
 {
     struct vcpu *v = current;
 
-    local_event_delivery_enable();
     set_bit(_VPF_blocked, &v->pause_flags);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
@@ -694,8 +693,12 @@ static long do_block(void)
         TRACE_2D(TRC_SCHED_BLOCK, v->domain->domain_id, v->vcpu_id);
         raise_softirq(SCHEDULE_SOFTIRQ);
     }
+}
 
-    return 0;
+static void vcpu_block_enable_events(void)
+{
+    local_event_delivery_enable();
+    vcpu_block();
 }
 
 static long do_poll(struct sched_poll *sched_poll)
@@ -870,7 +873,7 @@ long do_sched_op_compat(int cmd, unsigned long arg)
 
     case SCHEDOP_block:
     {
-        ret = do_block();
+        vcpu_block_enable_events();
         break;
     }
 
@@ -907,7 +910,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case SCHEDOP_block:
     {
-        ret = do_block();
+        vcpu_block_enable_events();
         break;
     }
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ad971d2..beadc42 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -690,6 +690,7 @@ static inline int vcpu_runnable(struct vcpu *v)
              atomic_read(&v->domain->pause_count));
 }
 
+void vcpu_block(void);
 void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:36:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:36: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 1UXQel-00067i-TQ; Wed, 01 May 2013 06:36:47 +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 1UXQek-00067d-Tq
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:36:47 +0000
Received: from [193.109.254.147:10889] by server-9.bemta-14.messagelabs.com id
	04/96-04223-EF7B0815; Wed, 01 May 2013 06:36:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1367390060!9714200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6719 invoked from network); 1 May 2013 06:34:22 -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;
	1 May 2013 06:34: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 1UXQcN-0004q4-Rj
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQcN-0003uN-Pi
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:19 +0000
Date: Wed, 01 May 2013 06:34:19 +0000
Message-Id: <E1UXQcN-0003uN-Pi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct platform detection
	in public header.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6aaee4960d8a56aeab9d962ce554dff7f987e1fd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 11:58:46 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:44:02 2013 +0100

    xen: arm: correct platform detection in public header.
    
    These headers cannot use the CONFIG_FOO defines provided when building Xen
    (since they aren't provided when building tools or by external components) and
    need to use the compiler provided architecture defines.
    
    This manifested itself as a failure to build xenctx.c on ARM64 due to the
    missing symbols contains .
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 746df8e..2f5ce18 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -218,7 +218,7 @@ typedef uint64_t xen_callback_t;
 #define PSR_MODE_SYS 0x1f
 
 /* 64 bit modes */
-#ifdef CONFIG_ARM_64
+#ifdef __aarch64__
 #define PSR_MODE_BIT  0x10 /* Set iff AArch32 */
 #define PSR_MODE_EL3h 0x0d
 #define PSR_MODE_EL3t 0x0c
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 06:36:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 06:36: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 1UXQel-00067i-TQ; Wed, 01 May 2013 06:36:47 +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 1UXQek-00067d-Tq
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:36:47 +0000
Received: from [193.109.254.147:10889] by server-9.bemta-14.messagelabs.com id
	04/96-04223-EF7B0815; Wed, 01 May 2013 06:36:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1367390060!9714200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6719 invoked from network); 1 May 2013 06:34:22 -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;
	1 May 2013 06:34: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 1UXQcN-0004q4-Rj
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXQcN-0003uN-Pi
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 06:34:19 +0000
Date: Wed, 01 May 2013 06:34:19 +0000
Message-Id: <E1UXQcN-0003uN-Pi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct platform detection
	in public header.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6aaee4960d8a56aeab9d962ce554dff7f987e1fd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 11:58:46 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Apr 30 11:44:02 2013 +0100

    xen: arm: correct platform detection in public header.
    
    These headers cannot use the CONFIG_FOO defines provided when building Xen
    (since they aren't provided when building tools or by external components) and
    need to use the compiler provided architecture defines.
    
    This manifested itself as a failure to build xenctx.c on ARM64 due to the
    missing symbols contains .
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 746df8e..2f5ce18 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -218,7 +218,7 @@ typedef uint64_t xen_callback_t;
 #define PSR_MODE_SYS 0x1f
 
 /* 64 bit modes */
-#ifdef CONFIG_ARM_64
+#ifdef __aarch64__
 #define PSR_MODE_BIT  0x10 /* Set iff AArch32 */
 #define PSR_MODE_EL3h 0x0d
 #define PSR_MODE_EL3t 0x0c
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXcwj-000232-Qy; Wed, 01 May 2013 19:44: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 1UXcwi-00022u-C6
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:08 +0000
Received: from [85.158.143.99:13696] by server-2.bemta-4.messagelabs.com id
	09/F8-27124-78071815; Wed, 01 May 2013 19:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367437445!27611839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21361 invoked from network); 1 May 2013 19:44:06 -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;
	1 May 2013 19:44: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 1UXcwd-0005ld-A2
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcwd-0006OI-4W
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:03 +0000
Date: Wed, 01 May 2013 19:44:03 +0000
Message-Id: <E1UXcwd-0006OI-4W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: adjust point of backend name
	resolution
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1612897f484ebb886b6bd143a0d55331370c28aa
Author:     Eric Shelton <eshelton@pobox.com>
AuthorDate: Tue Apr 30 11:03:03 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 12:52:37 2013 +0100

    libxl: adjust point of backend name resolution
    
    Resolution of a backend name to a domid needs to happen a little earlier
    in some cases.
    
    For example, if a domU is specified as a backend for a
    disk and, as previously written, libxl__device_disk_setdefault() calls
    libxl__resolve_domid() last, then disk->backend_domid still equals
    LIBXL_TOOLSTACK_DOMID when libxl__device_disk_set_backend() is called.
    This results in libxl__device_disk_set_backend() making an incorrect
    attempt to validate the target by calling stat() on a file on dom0,
    resulting in ERROR_INVAL (see libxl_device.c lines 239-248), which
    prevents creation of the frontend domain.
    
    Likewise, libxl__device_nic_setdefault() previously made use of
    nic->backend_domid before it was set.
    
    Signed-off-by: Eric Shelton <eshelton@pobox.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/libxl/libxl.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ea8281d..87bda72 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1978,10 +1978,10 @@ int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
     int rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
-    if (rc) return rc;
-
     rc = libxl__resolve_domid(gc, disk->backend_domname, &disk->backend_domid);
+    if (rc < 0) return rc;
+
+    rc = libxl__device_disk_set_backend(gc, disk);
     return rc;
 }
 
@@ -2812,6 +2812,10 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
         LOG(ERROR, "unable to get current hotplug scripts execution setting");
         return run_hotplug_scripts;
     }
+
+    rc = libxl__resolve_domid(gc, nic->backend_domname, &nic->backend_domid);
+    if (rc < 0) return rc;
+
     if (nic->backend_domid != LIBXL_TOOLSTACK_DOMID && run_hotplug_scripts) {
         LOG(ERROR, "cannot use a backend domain different than %d if"
                    "hotplug scripts are executed from libxl",
@@ -2837,7 +2841,6 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
         abort();
     }
 
-    rc = libxl__resolve_domid(gc, nic->backend_domname, &nic->backend_domid);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXcwj-000232-Qy; Wed, 01 May 2013 19:44: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 1UXcwi-00022u-C6
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:08 +0000
Received: from [85.158.143.99:13696] by server-2.bemta-4.messagelabs.com id
	09/F8-27124-78071815; Wed, 01 May 2013 19:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367437445!27611839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21361 invoked from network); 1 May 2013 19:44:06 -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;
	1 May 2013 19:44: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 1UXcwd-0005ld-A2
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcwd-0006OI-4W
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:03 +0000
Date: Wed, 01 May 2013 19:44:03 +0000
Message-Id: <E1UXcwd-0006OI-4W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: adjust point of backend name
	resolution
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1612897f484ebb886b6bd143a0d55331370c28aa
Author:     Eric Shelton <eshelton@pobox.com>
AuthorDate: Tue Apr 30 11:03:03 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 12:52:37 2013 +0100

    libxl: adjust point of backend name resolution
    
    Resolution of a backend name to a domid needs to happen a little earlier
    in some cases.
    
    For example, if a domU is specified as a backend for a
    disk and, as previously written, libxl__device_disk_setdefault() calls
    libxl__resolve_domid() last, then disk->backend_domid still equals
    LIBXL_TOOLSTACK_DOMID when libxl__device_disk_set_backend() is called.
    This results in libxl__device_disk_set_backend() making an incorrect
    attempt to validate the target by calling stat() on a file on dom0,
    resulting in ERROR_INVAL (see libxl_device.c lines 239-248), which
    prevents creation of the frontend domain.
    
    Likewise, libxl__device_nic_setdefault() previously made use of
    nic->backend_domid before it was set.
    
    Signed-off-by: Eric Shelton <eshelton@pobox.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/libxl/libxl.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ea8281d..87bda72 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1978,10 +1978,10 @@ int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
     int rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
-    if (rc) return rc;
-
     rc = libxl__resolve_domid(gc, disk->backend_domname, &disk->backend_domid);
+    if (rc < 0) return rc;
+
+    rc = libxl__device_disk_set_backend(gc, disk);
     return rc;
 }
 
@@ -2812,6 +2812,10 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
         LOG(ERROR, "unable to get current hotplug scripts execution setting");
         return run_hotplug_scripts;
     }
+
+    rc = libxl__resolve_domid(gc, nic->backend_domname, &nic->backend_domid);
+    if (rc < 0) return rc;
+
     if (nic->backend_domid != LIBXL_TOOLSTACK_DOMID && run_hotplug_scripts) {
         LOG(ERROR, "cannot use a backend domain different than %d if"
                    "hotplug scripts are executed from libxl",
@@ -2837,7 +2841,6 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
         abort();
     }
 
-    rc = libxl__resolve_domid(gc, nic->backend_domname, &nic->backend_domid);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44: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 1UXcwv-00023y-UD; Wed, 01 May 2013 19:44: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 1UXcwt-00023o-UQ
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:20 +0000
Received: from [85.158.137.99:54986] by server-13.bemta-3.messagelabs.com id
	B9/95-25744-29071815; Wed, 01 May 2013 19:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1367437457!20072311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18140 invoked from network); 1 May 2013 19:44: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;
	1 May 2013 19:44: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 1UXcwq-0005lh-Nv
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcwp-0006Og-RO
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:15 +0000
Date: Wed, 01 May 2013 19:44:15 +0000
Message-Id: <E1UXcwp-0006Og-RO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: add Samuel as stubdom and
	mini-os maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9e049fa424d8bc2384cf6b0475960d49a29acca0
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Apr 26 17:49:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 12:56:15 2013 +0100

    MAINTAINERS: add Samuel as stubdom and mini-os maintainer
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 MAINTAINERS |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index bcde139..7c672c8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -210,6 +210,7 @@ F:	xen/arch/x86/cpu/mcheck/
 
 MINI-OS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+M:	Samuel Thibault <samuel.thibault@ens-lyon.org>
 S:	Supported
 F:	extras/mini-os/
 
@@ -249,6 +250,7 @@ T:	git git://xenbits.xen.org/seabios.git
 
 STUB DOMAINS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+M:	Samuel Thibault <samuel.thibault@ens-lyon.org>
 S:	Supported
 F:	stubdom/
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44: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 1UXcwv-00023y-UD; Wed, 01 May 2013 19:44: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 1UXcwt-00023o-UQ
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:20 +0000
Received: from [85.158.137.99:54986] by server-13.bemta-3.messagelabs.com id
	B9/95-25744-29071815; Wed, 01 May 2013 19:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1367437457!20072311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18140 invoked from network); 1 May 2013 19:44: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;
	1 May 2013 19:44: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 1UXcwq-0005lh-Nv
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcwp-0006Og-RO
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:15 +0000
Date: Wed, 01 May 2013 19:44:15 +0000
Message-Id: <E1UXcwp-0006Og-RO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: add Samuel as stubdom and
	mini-os maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9e049fa424d8bc2384cf6b0475960d49a29acca0
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Apr 26 17:49:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 12:56:15 2013 +0100

    MAINTAINERS: add Samuel as stubdom and mini-os maintainer
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 MAINTAINERS |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index bcde139..7c672c8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -210,6 +210,7 @@ F:	xen/arch/x86/cpu/mcheck/
 
 MINI-OS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+M:	Samuel Thibault <samuel.thibault@ens-lyon.org>
 S:	Supported
 F:	extras/mini-os/
 
@@ -249,6 +250,7 @@ T:	git git://xenbits.xen.org/seabios.git
 
 STUB DOMAINS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+M:	Samuel Thibault <samuel.thibault@ens-lyon.org>
 S:	Supported
 F:	stubdom/
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXcx6-000252-0r; Wed, 01 May 2013 19:44: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 1UXcx4-00024n-PZ
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:31 +0000
Received: from [85.158.137.99:55403] by server-9.bemta-3.messagelabs.com id
	D6/0D-32531-D9071815; Wed, 01 May 2013 19:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1367437468!1570502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11406 invoked from network); 1 May 2013 19:44:29 -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;
	1 May 2013 19:44: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 1UXcx1-0005lt-SK
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcx0-0006P2-Tj
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:26 +0000
Date: Wed, 01 May 2013 19:44:26 +0000
Message-Id: <E1UXcx0-0006P2-Tj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: create pidfile in
	init-xenstore-domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3b779d88e4d82499d0823f7ac1f571f3051efe13
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Wed Apr 24 12:44:53 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 12:58:06 2013 +0100

    xenstore: create pidfile in init-xenstore-domain
    
    Since libxl checks for the existance of /var/run/xenstored.pid in order
    to ensure xenstore is running, create this file when starting the
    xenstore stub domain. This also changes the Makefile to enable the
    creation of the init-xenstore-domain tool during tools compilation,
    since the existing Makefile incorrectly added to the ALL_TARGETS list
    when compiling the stubdom, when this variable is not used.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile               |    5 ++++-
 tools/xenstore/init-xenstore-domain.c |   12 +++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 9172d3a..1bb6e58 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -29,9 +29,12 @@ endif
 
 ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored
 
+ifeq ($(CONFIG_Linux),y)
+ALL_TARGETS += init-xenstore-domain
+endif
+
 ifdef CONFIG_STUBDOM
 CFLAGS += -DNO_SOCKETS=1
-ALL_TARGETS += init-xenstore-domain
 endif
 
 .PHONY: all
diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
index 18c075b..35f1aa3 100644
--- a/tools/xenstore/init-xenstore-domain.c
+++ b/tools/xenstore/init-xenstore-domain.c
@@ -1,4 +1,5 @@
 #include <fcntl.h>
+#include <unistd.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
@@ -69,7 +70,7 @@ int main(int argc, char** argv)
 	xc_interface *xch;
 	struct xs_handle *xsh;
 	char buf[16];
-	int rv;
+	int rv, fd;
 
 	if (argc != 4) {
 		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label>\n", argv[0]);
@@ -90,5 +91,14 @@ int main(int argc, char** argv)
 	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
 	xs_daemon_close(xsh);
 
+	fd = creat("/var/run/xenstored.pid", 0666);
+	if (fd < 0)
+		return 3;
+	rv = snprintf(buf, 16, "domid:%d\n", domid);
+	rv = write(fd, buf, rv);
+	close(fd);
+	if (rv < 0)
+		return 3;
+
 	return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXcx6-000252-0r; Wed, 01 May 2013 19:44: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 1UXcx4-00024n-PZ
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:31 +0000
Received: from [85.158.137.99:55403] by server-9.bemta-3.messagelabs.com id
	D6/0D-32531-D9071815; Wed, 01 May 2013 19:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1367437468!1570502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11406 invoked from network); 1 May 2013 19:44:29 -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;
	1 May 2013 19:44: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 1UXcx1-0005lt-SK
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcx0-0006P2-Tj
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:26 +0000
Date: Wed, 01 May 2013 19:44:26 +0000
Message-Id: <E1UXcx0-0006P2-Tj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: create pidfile in
	init-xenstore-domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3b779d88e4d82499d0823f7ac1f571f3051efe13
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Wed Apr 24 12:44:53 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 12:58:06 2013 +0100

    xenstore: create pidfile in init-xenstore-domain
    
    Since libxl checks for the existance of /var/run/xenstored.pid in order
    to ensure xenstore is running, create this file when starting the
    xenstore stub domain. This also changes the Makefile to enable the
    creation of the init-xenstore-domain tool during tools compilation,
    since the existing Makefile incorrectly added to the ALL_TARGETS list
    when compiling the stubdom, when this variable is not used.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile               |    5 ++++-
 tools/xenstore/init-xenstore-domain.c |   12 +++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 9172d3a..1bb6e58 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -29,9 +29,12 @@ endif
 
 ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored
 
+ifeq ($(CONFIG_Linux),y)
+ALL_TARGETS += init-xenstore-domain
+endif
+
 ifdef CONFIG_STUBDOM
 CFLAGS += -DNO_SOCKETS=1
-ALL_TARGETS += init-xenstore-domain
 endif
 
 .PHONY: all
diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
index 18c075b..35f1aa3 100644
--- a/tools/xenstore/init-xenstore-domain.c
+++ b/tools/xenstore/init-xenstore-domain.c
@@ -1,4 +1,5 @@
 #include <fcntl.h>
+#include <unistd.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
@@ -69,7 +70,7 @@ int main(int argc, char** argv)
 	xc_interface *xch;
 	struct xs_handle *xsh;
 	char buf[16];
-	int rv;
+	int rv, fd;
 
 	if (argc != 4) {
 		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label>\n", argv[0]);
@@ -90,5 +91,14 @@ int main(int argc, char** argv)
 	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
 	xs_daemon_close(xsh);
 
+	fd = creat("/var/run/xenstored.pid", 0666);
+	if (fd < 0)
+		return 3;
+	rv = snprintf(buf, 16, "domid:%d\n", domid);
+	rv = write(fd, buf, rv);
+	close(fd);
+	if (rv < 0)
+		return 3;
+
 	return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44: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 1UXcxG-00026G-40; Wed, 01 May 2013 19:44: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 1UXcxF-000263-4U
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:41 +0000
Received: from [85.158.138.51:59501] by server-9.bemta-3.messagelabs.com id
	40/2D-32531-8A071815; Wed, 01 May 2013 19:44:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1367437478!30849305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28082 invoked from network); 1 May 2013 19:44:39 -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;
	1 May 2013 19:44: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 1UXcxC-0005lz-2X
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcxB-0006Q2-WD
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:38 +0000
Date: Wed, 01 May 2013 19:44:37 +0000
Message-Id: <E1UXcxB-0006Q2-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: nuke some stray hard tabs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 196f03ab8401830390ae364c607aa81b4253507a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Apr 30 16:02:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 13:00:52 2013 +0100

    xen/arm: nuke some stray hard tabs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain.c      |   10 +++++-----
 xen/include/asm-arm/numa.h |    2 +-
 xen/include/xen/irq.h      |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index a28275e..2af40a1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -620,12 +620,12 @@ int domain_relinquish_resources(struct domain *d)
 
 void arch_dump_domain_info(struct domain *d)
 {
-	struct vcpu *v;
+    struct vcpu *v;
 
-	for_each_vcpu ( d, v )
-	{
-		gic_dump_info(v);
-	}
+    for_each_vcpu ( d, v )
+    {
+        gic_dump_info(v);
+    }
 }
 
 long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index d9400ac..cb8f2ba 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -11,7 +11,7 @@ static inline __attribute__((pure)) int phys_to_nid(paddr_t addr)
 }
 
 /* XXX: implement NUMA support */
-#define node_spanned_pages(nid)	(total_pages)
+#define node_spanned_pages(nid) (total_pages)
 #define __node_distance(a, b) (20)
 
 #endif /* __ARCH_ARM_NUMA_H */
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 7386358..eaf1a84 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -65,10 +65,10 @@ struct msi_desc;
  * whether it is disabled etc etc.
  */
 typedef struct irq_desc {
-    unsigned int status;		/* IRQ status */
+    unsigned int status;        /* IRQ status */
     hw_irq_controller *handler;
     struct msi_desc   *msi_desc;
-    struct irqaction *action;	/* IRQ action list */
+    struct irqaction *action;   /* IRQ action list */
     int irq;
     spinlock_t lock;
     struct arch_irq_desc arch;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44: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 1UXcxG-00026G-40; Wed, 01 May 2013 19:44: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 1UXcxF-000263-4U
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:41 +0000
Received: from [85.158.138.51:59501] by server-9.bemta-3.messagelabs.com id
	40/2D-32531-8A071815; Wed, 01 May 2013 19:44:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1367437478!30849305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28082 invoked from network); 1 May 2013 19:44:39 -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;
	1 May 2013 19:44: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 1UXcxC-0005lz-2X
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcxB-0006Q2-WD
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:38 +0000
Date: Wed, 01 May 2013 19:44:37 +0000
Message-Id: <E1UXcxB-0006Q2-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: nuke some stray hard tabs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 196f03ab8401830390ae364c607aa81b4253507a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Apr 30 16:02:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 13:00:52 2013 +0100

    xen/arm: nuke some stray hard tabs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain.c      |   10 +++++-----
 xen/include/asm-arm/numa.h |    2 +-
 xen/include/xen/irq.h      |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index a28275e..2af40a1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -620,12 +620,12 @@ int domain_relinquish_resources(struct domain *d)
 
 void arch_dump_domain_info(struct domain *d)
 {
-	struct vcpu *v;
+    struct vcpu *v;
 
-	for_each_vcpu ( d, v )
-	{
-		gic_dump_info(v);
-	}
+    for_each_vcpu ( d, v )
+    {
+        gic_dump_info(v);
+    }
 }
 
 long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index d9400ac..cb8f2ba 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -11,7 +11,7 @@ static inline __attribute__((pure)) int phys_to_nid(paddr_t addr)
 }
 
 /* XXX: implement NUMA support */
-#define node_spanned_pages(nid)	(total_pages)
+#define node_spanned_pages(nid) (total_pages)
 #define __node_distance(a, b) (20)
 
 #endif /* __ARCH_ARM_NUMA_H */
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 7386358..eaf1a84 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -65,10 +65,10 @@ struct msi_desc;
  * whether it is disabled etc etc.
  */
 typedef struct irq_desc {
-    unsigned int status;		/* IRQ status */
+    unsigned int status;        /* IRQ status */
     hw_irq_controller *handler;
     struct msi_desc   *msi_desc;
-    struct irqaction *action;	/* IRQ action list */
+    struct irqaction *action;   /* IRQ action list */
     int irq;
     spinlock_t lock;
     struct arch_irq_desc arch;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44: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 1UXcxQ-00027y-6z; Wed, 01 May 2013 19:44:52 +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 1UXcxP-00027c-7F
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:51 +0000
Received: from [85.158.137.99:56170] by server-16.bemta-3.messagelabs.com id
	A0/29-20692-2B071815; Wed, 01 May 2013 19:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1367437488!16887418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14289 invoked from network); 1 May 2013 19:44:49 -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;
	1 May 2013 19:44:49 -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 1UXcxM-0005m7-9X
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcxM-0006QR-6x
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:48 +0000
Date: Wed, 01 May 2013 19:44:48 +0000
Message-Id: <E1UXcxM-0006QR-6x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: unconst the event argument to
	the event_occurs hook.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 5fb11a07023959b6c91f7f37124699681011c03a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 12:42:24 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 13:00:57 2013 +0100

    libxl: unconst the event argument to the event_occurs hook.
    
    The event is supposed to become owned, and therefore freed, by the application
    and the const prevents this.
    
    Unfortunately there is no way to remove the const without breaking existing
    callers. The best we can do is use the LIBXL_API_VERSION provisions to remove
    the const for callers who wish only to support the 4.3 API and newer.
    
    Callers who wish to support 4.2 will need to live with casting away the const.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.h       |   14 ++++++++++++--
 tools/libxl/libxl_event.h |    6 +++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 25efa76..ef96bce 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -273,9 +273,9 @@
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
-/* API compatibility. Only 0x040200 is supported at this time. */
+/* API compatibility. */
 #ifdef LIBXL_API_VERSION
-#if LIBXL_API_VERSION != 0x040200
+#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -308,6 +308,16 @@
  */
 #define LIBXL_HAVE_DEVICE_BACKEND_DOMNAME 1
 
+/*
+ * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+ *
+ * This argument was erroneously "const" in the 4.2 release despite
+ * the requirement for the callback to free the event.
+ */
+#if LIBXL_API_VERSION != 0x040200
+#define LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG 1
+#endif
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index 51f2721..27a65dc 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -64,7 +64,11 @@ void libxl_event_free(libxl_ctx *ctx, libxl_event *event);
 
 typedef struct libxl_event_hooks {
     uint64_t event_occurs_mask;
-    void (*event_occurs)(void *user, const libxl_event *event);
+    void (*event_occurs)(void *user,
+#ifndef LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+                         const
+#endif
+                         libxl_event *event);
     void (*disaster)(void *user, libxl_event_type type,
                      const char *msg, int errnoval);
 } libxl_event_hooks;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 01 19:44:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 May 2013 19:44: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 1UXcxQ-00027y-6z; Wed, 01 May 2013 19:44:52 +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 1UXcxP-00027c-7F
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:51 +0000
Received: from [85.158.137.99:56170] by server-16.bemta-3.messagelabs.com id
	A0/29-20692-2B071815; Wed, 01 May 2013 19:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1367437488!16887418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14289 invoked from network); 1 May 2013 19:44:49 -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;
	1 May 2013 19:44:49 -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 1UXcxM-0005m7-9X
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXcxM-0006QR-6x
	for xen-changelog@lists.xensource.com; Wed, 01 May 2013 19:44:48 +0000
Date: Wed, 01 May 2013 19:44:48 +0000
Message-Id: <E1UXcxM-0006QR-6x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: unconst the event argument to
	the event_occurs hook.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 5fb11a07023959b6c91f7f37124699681011c03a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 12:42:24 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 1 13:00:57 2013 +0100

    libxl: unconst the event argument to the event_occurs hook.
    
    The event is supposed to become owned, and therefore freed, by the application
    and the const prevents this.
    
    Unfortunately there is no way to remove the const without breaking existing
    callers. The best we can do is use the LIBXL_API_VERSION provisions to remove
    the const for callers who wish only to support the 4.3 API and newer.
    
    Callers who wish to support 4.2 will need to live with casting away the const.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.h       |   14 ++++++++++++--
 tools/libxl/libxl_event.h |    6 +++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 25efa76..ef96bce 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -273,9 +273,9 @@
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
-/* API compatibility. Only 0x040200 is supported at this time. */
+/* API compatibility. */
 #ifdef LIBXL_API_VERSION
-#if LIBXL_API_VERSION != 0x040200
+#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -308,6 +308,16 @@
  */
 #define LIBXL_HAVE_DEVICE_BACKEND_DOMNAME 1
 
+/*
+ * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+ *
+ * This argument was erroneously "const" in the 4.2 release despite
+ * the requirement for the callback to free the event.
+ */
+#if LIBXL_API_VERSION != 0x040200
+#define LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG 1
+#endif
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index 51f2721..27a65dc 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -64,7 +64,11 @@ void libxl_event_free(libxl_ctx *ctx, libxl_event *event);
 
 typedef struct libxl_event_hooks {
     uint64_t event_occurs_mask;
-    void (*event_occurs)(void *user, const libxl_event *event);
+    void (*event_occurs)(void *user,
+#ifndef LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+                         const
+#endif
+                         libxl_event *event);
     void (*disaster)(void *user, libxl_event_type type,
                      const char *msg, int errnoval);
 } libxl_event_hooks;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 02 19:00:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 May 2013 19:00: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 1UXyjh-0005CA-EU; Thu, 02 May 2013 19:00:09 +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 1UXyjh-0005Bz-2c
	for xen-changelog@lists.xensource.com; Thu, 02 May 2013 19:00:09 +0000
Received: from [85.158.139.83:52251] by server-11.bemta-5.messagelabs.com id
	E1/D5-26693-6B7B2815; Thu, 02 May 2013 19:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1367521204!28670768!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10211 invoked from network); 2 May 2013 19:00:05 -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;
	2 May 2013 19:00: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 1UXyjc-0006Jc-7e
	for xen-changelog@lists.xensource.com; Thu, 02 May 2013 19:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXyjb-00076E-2M
	for xen-changelog@lists.xensource.com; Thu, 02 May 2013 19:00:03 +0000
Date: Thu, 02 May 2013 19:00:03 +0000
Message-Id: <E1UXyjb-00076E-2M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: call unmap_vcpu_info() regardless
	of guest 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 9626d1c1fafe2da5af6e59478c9e9db6d03144df
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 09:29:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 09:29:36 2013 +0200

    x86: call unmap_vcpu_info() regardless of guest type
    
    This fixes a regression from 63753b3e ("x86: allow
    VCPUOP_register_vcpu_info to work again on PVHVM guests").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
---
 xen/arch/x86/domain.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 14b6d13..3e09f58 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2013,8 +2013,12 @@ int domain_relinquish_resources(struct domain *d)
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
+        {
             vcpu_destroy_pagetables(v);
 
+            unmap_vcpu_info(v);
+        }
+
         if ( !is_hvm_domain(d) )
         {
             for_each_vcpu ( d, v )
@@ -2025,8 +2029,6 @@ int domain_relinquish_resources(struct domain *d)
                  * mappings.
                  */
                 destroy_gdt(v);
-
-                unmap_vcpu_info(v);
             }
 
             if ( d->arch.pv_domain.pirq_eoi_map != NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 02 19:00:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 May 2013 19:00: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 1UXyjh-0005CA-EU; Thu, 02 May 2013 19:00:09 +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 1UXyjh-0005Bz-2c
	for xen-changelog@lists.xensource.com; Thu, 02 May 2013 19:00:09 +0000
Received: from [85.158.139.83:52251] by server-11.bemta-5.messagelabs.com id
	E1/D5-26693-6B7B2815; Thu, 02 May 2013 19:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1367521204!28670768!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10211 invoked from network); 2 May 2013 19:00:05 -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;
	2 May 2013 19:00: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 1UXyjc-0006Jc-7e
	for xen-changelog@lists.xensource.com; Thu, 02 May 2013 19:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXyjb-00076E-2M
	for xen-changelog@lists.xensource.com; Thu, 02 May 2013 19:00:03 +0000
Date: Thu, 02 May 2013 19:00:03 +0000
Message-Id: <E1UXyjb-00076E-2M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: call unmap_vcpu_info() regardless
	of guest 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 9626d1c1fafe2da5af6e59478c9e9db6d03144df
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 09:29:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 09:29:36 2013 +0200

    x86: call unmap_vcpu_info() regardless of guest type
    
    This fixes a regression from 63753b3e ("x86: allow
    VCPUOP_register_vcpu_info to work again on PVHVM guests").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
---
 xen/arch/x86/domain.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 14b6d13..3e09f58 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2013,8 +2013,12 @@ int domain_relinquish_resources(struct domain *d)
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
+        {
             vcpu_destroy_pagetables(v);
 
+            unmap_vcpu_info(v);
+        }
+
         if ( !is_hvm_domain(d) )
         {
             for_each_vcpu ( d, v )
@@ -2025,8 +2029,6 @@ int domain_relinquish_resources(struct domain *d)
                  * mappings.
                  */
                 destroy_gdt(v);
-
-                unmap_vcpu_info(v);
             }
 
             if ( d->arch.pv_domain.pirq_eoi_map != NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY46c-0003cg-Ta; Fri, 03 May 2013 00:44: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 1UY46b-0003ca-DH
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:09 +0000
Received: from [85.158.139.83:20592] by server-5.bemta-5.messagelabs.com id
	E8/64-06980-85803815; Fri, 03 May 2013 00:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1367541846!28712343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10488 invoked from network); 3 May 2013 00:44:07 -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;
	3 May 2013 00: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 1UY46Y-0001zZ-CK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY46V-0007Uf-KU
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:03 +0000
Date: Fri, 03 May 2013 00:44:03 +0000
Message-Id: <E1UY46V-0007Uf-KU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make
	vcpu_destroy_pagetables() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7a93b9a11c99a88f293c3e1e3a79914b6d13b3aa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:22:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:22:36 2013 +0200

    x86: make vcpu_destroy_pagetables() preemptible
    
    ... as it may take significant amounts of time.
    
    The function, being moved to mm.c as the better home for it anyway, and
    to avoid having to make a new helper function there non-static, is
    given a "preemptible" parameter temporarily (until, in a subsequent
    patch, its other caller is also being made capable of dealing with
    preemption).
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 6cdc9be2a5f2a87b4504404fbf648d16d9503c19
    master date: 2013-05-02 16:34:21 +0200
---
 xen/arch/x86/domain.c           |   65 ++--------------------------
 xen/arch/x86/mm.c               |   89 ++++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |    2 +-
 xen/include/asm-x86/domain.h    |    1 +
 xen/include/asm-x86/mm.h        |    1 +
 5 files changed, 94 insertions(+), 64 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4009a60..4b79db0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -70,8 +70,6 @@ void (*dead_idle) (void) __read_mostly = default_dead_idle;
 static void paravirt_ctxt_switch_from(struct vcpu *v);
 static void paravirt_ctxt_switch_to(struct vcpu *v);
 
-static void vcpu_destroy_pagetables(struct vcpu *v);
-
 static void continue_idle_domain(struct vcpu *v)
 {
     reset_stack_and_jump(idle_loop);
@@ -909,7 +907,7 @@ void arch_vcpu_reset(struct vcpu *v)
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v);
+        vcpu_destroy_pagetables(v, 0);
     }
     else
     {
@@ -1917,63 +1915,6 @@ static int relinquish_memory(
     return ret;
 }
 
-static void vcpu_destroy_pagetables(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long pfn;
-
-#ifdef __x86_64__
-    if ( is_pv_32on64_vcpu(v) )
-    {
-        pfn = l4e_get_pfn(*(l4_pgentry_t *)
-                          __va(pagetable_get_paddr(v->arch.guest_table)));
-
-        if ( pfn != 0 )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-
-        l4e_write(
-            (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
-            l4e_empty());
-
-        v->arch.cr3 = 0;
-        return;
-    }
-#endif
-
-    pfn = pagetable_get_pfn(v->arch.guest_table);
-    if ( pfn != 0 )
-    {
-        if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(pfn));
-        else
-            put_page_and_type(mfn_to_page(pfn));
-        v->arch.guest_table = pagetable_null();
-    }
-
-#ifdef __x86_64__
-    /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
-    pfn = pagetable_get_pfn(v->arch.guest_table_user);
-    if ( pfn != 0 )
-    {
-        if ( !is_pv_32bit_vcpu(v) )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-        v->arch.guest_table_user = pagetable_null();
-    }
-#endif
-
-    v->arch.cr3 = 0;
-}
-
 int domain_relinquish_resources(struct domain *d)
 {
     int ret;
@@ -1992,7 +1933,9 @@ int domain_relinquish_resources(struct domain *d)
         for_each_vcpu ( d, v )
         {
             /* Drop the in-use references to page-table bases. */
-            vcpu_destroy_pagetables(v);
+            ret = vcpu_destroy_pagetables(v, 1);
+            if ( ret )
+                return ret;
 
             /*
              * Relinquish GDT mappings. No need for explicit unmapping of the
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0ee088a..f62e7c7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2725,6 +2725,82 @@ static void put_superpage(unsigned long mfn)
 
 #endif
 
+static int put_old_guest_table(struct vcpu *v)
+{
+    int rc;
+
+    if ( !v->arch.old_guest_table )
+        return 0;
+
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    {
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    }
+
+    v->arch.old_guest_table = NULL;
+
+    return rc;
+}
+
+int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+{
+    unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
+    struct page_info *page;
+    int rc = put_old_guest_table(v);
+
+    if ( rc )
+        return rc;
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+        mfn = l4e_get_pfn(*(l4_pgentry_t *)mfn_to_virt(mfn));
+#endif
+
+    if ( mfn )
+    {
+        page = mfn_to_page(mfn);
+        if ( paging_mode_refcounts(v->domain) )
+            put_page(page);
+        else
+            rc = put_page_and_type_preemptible(page, preemptible);
+    }
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+    {
+        if ( !rc )
+            l4e_write(
+                (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
+                l4e_empty());
+    }
+    else
+#endif
+    if ( !rc )
+    {
+        v->arch.guest_table = pagetable_null();
+
+#ifdef __x86_64__
+        /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
+        mfn = pagetable_get_pfn(v->arch.guest_table_user);
+        if ( mfn )
+        {
+            page = mfn_to_page(mfn);
+            if ( paging_mode_refcounts(v->domain) )
+                put_page(page);
+            else
+                rc = put_page_and_type_preemptible(page, preemptible);
+        }
+        if ( !rc )
+            v->arch.guest_table_user = pagetable_null();
+#endif
+    }
+
+    v->arch.cr3 = 0;
+
+    return rc;
+}
 
 int new_guest_cr3(unsigned long mfn)
 {
@@ -2911,12 +2987,21 @@ long do_mmuext_op(
     unsigned int foreigndom)
 {
     struct mmuext_op op;
-    int rc = 0, i = 0, okay;
     unsigned long type;
-    unsigned int done = 0;
+    unsigned int i = 0, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
+    int okay, rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmuext_op, "hihi", uops, count, pdone,
+                     foreigndom);
+        return rc;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 3ef08a5..7b6ad6d 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -319,7 +319,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
 
-                BUG_ON(left == arg1);
+                BUG_ON(left == arg1 && left != i);
                 BUG_ON(left > count);
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index fe1459d..a387862 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -405,6 +405,7 @@ struct arch_vcpu
     pagetable_t guest_table_user;       /* (MFN) x86/64 user-space pagetable */
 #endif
     pagetable_t guest_table;            /* (MFN) guest notion of cr3 */
+    struct page_info *old_guest_table;  /* partially destructed pagetable */
     /* guest_table holds a ref to the page, and also a type-count unless
      * shadow refcounts are in use */
     pagetable_t shadow_table[4];        /* (MFN) shadow(s) of guest */
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index cedab73..d24e132 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,6 +555,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
+int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY46c-0003cg-Ta; Fri, 03 May 2013 00:44: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 1UY46b-0003ca-DH
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:09 +0000
Received: from [85.158.139.83:20592] by server-5.bemta-5.messagelabs.com id
	E8/64-06980-85803815; Fri, 03 May 2013 00:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1367541846!28712343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10488 invoked from network); 3 May 2013 00:44:07 -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;
	3 May 2013 00: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 1UY46Y-0001zZ-CK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY46V-0007Uf-KU
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:03 +0000
Date: Fri, 03 May 2013 00:44:03 +0000
Message-Id: <E1UY46V-0007Uf-KU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make
	vcpu_destroy_pagetables() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7a93b9a11c99a88f293c3e1e3a79914b6d13b3aa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:22:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:22:36 2013 +0200

    x86: make vcpu_destroy_pagetables() preemptible
    
    ... as it may take significant amounts of time.
    
    The function, being moved to mm.c as the better home for it anyway, and
    to avoid having to make a new helper function there non-static, is
    given a "preemptible" parameter temporarily (until, in a subsequent
    patch, its other caller is also being made capable of dealing with
    preemption).
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 6cdc9be2a5f2a87b4504404fbf648d16d9503c19
    master date: 2013-05-02 16:34:21 +0200
---
 xen/arch/x86/domain.c           |   65 ++--------------------------
 xen/arch/x86/mm.c               |   89 ++++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |    2 +-
 xen/include/asm-x86/domain.h    |    1 +
 xen/include/asm-x86/mm.h        |    1 +
 5 files changed, 94 insertions(+), 64 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4009a60..4b79db0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -70,8 +70,6 @@ void (*dead_idle) (void) __read_mostly = default_dead_idle;
 static void paravirt_ctxt_switch_from(struct vcpu *v);
 static void paravirt_ctxt_switch_to(struct vcpu *v);
 
-static void vcpu_destroy_pagetables(struct vcpu *v);
-
 static void continue_idle_domain(struct vcpu *v)
 {
     reset_stack_and_jump(idle_loop);
@@ -909,7 +907,7 @@ void arch_vcpu_reset(struct vcpu *v)
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v);
+        vcpu_destroy_pagetables(v, 0);
     }
     else
     {
@@ -1917,63 +1915,6 @@ static int relinquish_memory(
     return ret;
 }
 
-static void vcpu_destroy_pagetables(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long pfn;
-
-#ifdef __x86_64__
-    if ( is_pv_32on64_vcpu(v) )
-    {
-        pfn = l4e_get_pfn(*(l4_pgentry_t *)
-                          __va(pagetable_get_paddr(v->arch.guest_table)));
-
-        if ( pfn != 0 )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-
-        l4e_write(
-            (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
-            l4e_empty());
-
-        v->arch.cr3 = 0;
-        return;
-    }
-#endif
-
-    pfn = pagetable_get_pfn(v->arch.guest_table);
-    if ( pfn != 0 )
-    {
-        if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(pfn));
-        else
-            put_page_and_type(mfn_to_page(pfn));
-        v->arch.guest_table = pagetable_null();
-    }
-
-#ifdef __x86_64__
-    /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
-    pfn = pagetable_get_pfn(v->arch.guest_table_user);
-    if ( pfn != 0 )
-    {
-        if ( !is_pv_32bit_vcpu(v) )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-        v->arch.guest_table_user = pagetable_null();
-    }
-#endif
-
-    v->arch.cr3 = 0;
-}
-
 int domain_relinquish_resources(struct domain *d)
 {
     int ret;
@@ -1992,7 +1933,9 @@ int domain_relinquish_resources(struct domain *d)
         for_each_vcpu ( d, v )
         {
             /* Drop the in-use references to page-table bases. */
-            vcpu_destroy_pagetables(v);
+            ret = vcpu_destroy_pagetables(v, 1);
+            if ( ret )
+                return ret;
 
             /*
              * Relinquish GDT mappings. No need for explicit unmapping of the
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0ee088a..f62e7c7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2725,6 +2725,82 @@ static void put_superpage(unsigned long mfn)
 
 #endif
 
+static int put_old_guest_table(struct vcpu *v)
+{
+    int rc;
+
+    if ( !v->arch.old_guest_table )
+        return 0;
+
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    {
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    }
+
+    v->arch.old_guest_table = NULL;
+
+    return rc;
+}
+
+int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+{
+    unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
+    struct page_info *page;
+    int rc = put_old_guest_table(v);
+
+    if ( rc )
+        return rc;
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+        mfn = l4e_get_pfn(*(l4_pgentry_t *)mfn_to_virt(mfn));
+#endif
+
+    if ( mfn )
+    {
+        page = mfn_to_page(mfn);
+        if ( paging_mode_refcounts(v->domain) )
+            put_page(page);
+        else
+            rc = put_page_and_type_preemptible(page, preemptible);
+    }
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+    {
+        if ( !rc )
+            l4e_write(
+                (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
+                l4e_empty());
+    }
+    else
+#endif
+    if ( !rc )
+    {
+        v->arch.guest_table = pagetable_null();
+
+#ifdef __x86_64__
+        /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
+        mfn = pagetable_get_pfn(v->arch.guest_table_user);
+        if ( mfn )
+        {
+            page = mfn_to_page(mfn);
+            if ( paging_mode_refcounts(v->domain) )
+                put_page(page);
+            else
+                rc = put_page_and_type_preemptible(page, preemptible);
+        }
+        if ( !rc )
+            v->arch.guest_table_user = pagetable_null();
+#endif
+    }
+
+    v->arch.cr3 = 0;
+
+    return rc;
+}
 
 int new_guest_cr3(unsigned long mfn)
 {
@@ -2911,12 +2987,21 @@ long do_mmuext_op(
     unsigned int foreigndom)
 {
     struct mmuext_op op;
-    int rc = 0, i = 0, okay;
     unsigned long type;
-    unsigned int done = 0;
+    unsigned int i = 0, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
+    int okay, rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmuext_op, "hihi", uops, count, pdone,
+                     foreigndom);
+        return rc;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 3ef08a5..7b6ad6d 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -319,7 +319,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
 
-                BUG_ON(left == arg1);
+                BUG_ON(left == arg1 && left != i);
                 BUG_ON(left > count);
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index fe1459d..a387862 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -405,6 +405,7 @@ struct arch_vcpu
     pagetable_t guest_table_user;       /* (MFN) x86/64 user-space pagetable */
 #endif
     pagetable_t guest_table;            /* (MFN) guest notion of cr3 */
+    struct page_info *old_guest_table;  /* partially destructed pagetable */
     /* guest_table holds a ref to the page, and also a type-count unless
      * shadow refcounts are in use */
     pagetable_t shadow_table[4];        /* (MFN) shadow(s) of guest */
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index cedab73..d24e132 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,6 +555,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
+int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY46p-0003dU-0I; Fri, 03 May 2013 00:44: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 1UY46m-0003d6-Sn
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:21 +0000
Received: from [85.158.137.99:4887] by server-14.bemta-3.messagelabs.com id
	4F/8D-20016-36803815; Fri, 03 May 2013 00:44:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1367541858!1784715!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23916 invoked from network); 3 May 2013 00:44:19 -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;
	3 May 2013 00:44: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 1UY46j-0001zg-OO
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY46i-0007V3-Iw
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:16 +0000
Date: Fri, 03 May 2013 00:44:16 +0000
Message-Id: <E1UY46i-0007V3-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make new_guest_cr3()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 06a68a09df243b175d1737a95df2e6f153cbae42
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:23:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:23:31 2013 +0200

    x86: make new_guest_cr3() preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: e2e6b7b627fec0d7a769ab46441f2985ebccbf04
    master date: 2013-05-02 16:35:50 +0200
---
 xen/arch/x86/mm.c    |   76 +++++++++++++++++++++++++++++++++++++------------
 xen/arch/x86/traps.c |    9 +++++-
 2 files changed, 65 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f62e7c7..cc6242e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2806,44 +2806,69 @@ int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
-    int okay;
+    int rc;
     unsigned long old_base_mfn;
 
 #ifdef __x86_64__
     if ( is_pv_32on64_domain(d) )
     {
-        okay = paging_mode_refcounts(d)
-            ? 0 /* Old code was broken, but what should it be? */
-            : mod_l4_entry(
+        rc = paging_mode_refcounts(d)
+             ? -EINVAL /* Old code was broken, but what should it be? */
+             : mod_l4_entry(
                     __va(pagetable_get_paddr(curr->arch.guest_table)),
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 0, curr) == 0;
-        if ( unlikely(!okay) )
+                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+        switch ( rc )
         {
+        case 0:
+            break;
+        case -EINTR:
+        case -EAGAIN:
+            return -EAGAIN;
+        default:
             MEM_LOG("Error while installing new compat baseptr %lx", mfn);
-            return 0;
+            return rc;
         }
 
         invalidate_shadow_ldt(curr, 0);
         write_ptbase(curr);
 
-        return 1;
+        return 0;
     }
 #endif
-    okay = paging_mode_refcounts(d)
-        ? get_page_from_pagenr(mfn, d)
-        : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
-    if ( unlikely(!okay) )
+    rc = put_old_guest_table(curr);
+    if ( unlikely(rc) )
+        return rc;
+
+    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    /*
+     * This is particularly important when getting restarted after the
+     * previous attempt got preempted in the put-old-MFN phase.
+     */
+    if ( old_base_mfn == mfn )
     {
-        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        write_ptbase(curr);
         return 0;
     }
 
-    invalidate_shadow_ldt(curr, 0);
+    rc = paging_mode_refcounts(d)
+         ? (get_page_from_pagenr(mfn, d) ? 0 : -EINVAL)
+         : get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 1);
+    switch ( rc )
+    {
+    case 0:
+        break;
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    default:
+        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        return rc;
+    }
 
-    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    invalidate_shadow_ldt(curr, 0);
 
     curr->arch.guest_table = pagetable_from_pfn(mfn);
     update_cr3(curr);
@@ -2852,13 +2877,25 @@ int new_guest_cr3(unsigned long mfn)
 
     if ( likely(old_base_mfn != 0) )
     {
+        struct page_info *page = mfn_to_page(old_base_mfn);
+
         if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(old_base_mfn));
+            put_page(page);
         else
-            put_page_and_type(mfn_to_page(old_base_mfn));
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+                rc = -EAGAIN;
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
     }
 
-    return 1;
+    return rc;
 }
 
 static struct domain *get_pg_owner(domid_t domid)
@@ -3154,7 +3191,8 @@ long do_mmuext_op(
         }
 
         case MMUEXT_NEW_BASEPTR:
-            okay = new_guest_cr3(gmfn_to_mfn(d, op.arg1.mfn));
+            rc = new_guest_cr3(gmfn_to_mfn(d, op.arg1.mfn));
+            okay = !rc;
             break;
         
 #ifdef __x86_64__
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 5a48a2a..7e4e6b6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2317,8 +2317,15 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                 rc = new_guest_cr3(gmfn_to_mfn(v->domain, compat_cr3_to_pfn(*reg)));
 #endif
             domain_unlock(v->domain);
-            if ( rc == 0 ) /* not okay */
+            switch ( rc )
+            {
+            case 0:
+                break;
+            case -EAGAIN: /* retry after preemption */
+                goto skip;
+            default:      /* not okay */
                 goto fail;
+            }
             break;
 
         case 4: /* Write CR4 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY46p-0003dU-0I; Fri, 03 May 2013 00:44: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 1UY46m-0003d6-Sn
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:21 +0000
Received: from [85.158.137.99:4887] by server-14.bemta-3.messagelabs.com id
	4F/8D-20016-36803815; Fri, 03 May 2013 00:44:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1367541858!1784715!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23916 invoked from network); 3 May 2013 00:44:19 -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;
	3 May 2013 00:44: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 1UY46j-0001zg-OO
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY46i-0007V3-Iw
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:16 +0000
Date: Fri, 03 May 2013 00:44:16 +0000
Message-Id: <E1UY46i-0007V3-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make new_guest_cr3()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 06a68a09df243b175d1737a95df2e6f153cbae42
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:23:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:23:31 2013 +0200

    x86: make new_guest_cr3() preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: e2e6b7b627fec0d7a769ab46441f2985ebccbf04
    master date: 2013-05-02 16:35:50 +0200
---
 xen/arch/x86/mm.c    |   76 +++++++++++++++++++++++++++++++++++++------------
 xen/arch/x86/traps.c |    9 +++++-
 2 files changed, 65 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f62e7c7..cc6242e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2806,44 +2806,69 @@ int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
-    int okay;
+    int rc;
     unsigned long old_base_mfn;
 
 #ifdef __x86_64__
     if ( is_pv_32on64_domain(d) )
     {
-        okay = paging_mode_refcounts(d)
-            ? 0 /* Old code was broken, but what should it be? */
-            : mod_l4_entry(
+        rc = paging_mode_refcounts(d)
+             ? -EINVAL /* Old code was broken, but what should it be? */
+             : mod_l4_entry(
                     __va(pagetable_get_paddr(curr->arch.guest_table)),
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 0, curr) == 0;
-        if ( unlikely(!okay) )
+                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+        switch ( rc )
         {
+        case 0:
+            break;
+        case -EINTR:
+        case -EAGAIN:
+            return -EAGAIN;
+        default:
             MEM_LOG("Error while installing new compat baseptr %lx", mfn);
-            return 0;
+            return rc;
         }
 
         invalidate_shadow_ldt(curr, 0);
         write_ptbase(curr);
 
-        return 1;
+        return 0;
     }
 #endif
-    okay = paging_mode_refcounts(d)
-        ? get_page_from_pagenr(mfn, d)
-        : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
-    if ( unlikely(!okay) )
+    rc = put_old_guest_table(curr);
+    if ( unlikely(rc) )
+        return rc;
+
+    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    /*
+     * This is particularly important when getting restarted after the
+     * previous attempt got preempted in the put-old-MFN phase.
+     */
+    if ( old_base_mfn == mfn )
     {
-        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        write_ptbase(curr);
         return 0;
     }
 
-    invalidate_shadow_ldt(curr, 0);
+    rc = paging_mode_refcounts(d)
+         ? (get_page_from_pagenr(mfn, d) ? 0 : -EINVAL)
+         : get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 1);
+    switch ( rc )
+    {
+    case 0:
+        break;
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    default:
+        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        return rc;
+    }
 
-    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    invalidate_shadow_ldt(curr, 0);
 
     curr->arch.guest_table = pagetable_from_pfn(mfn);
     update_cr3(curr);
@@ -2852,13 +2877,25 @@ int new_guest_cr3(unsigned long mfn)
 
     if ( likely(old_base_mfn != 0) )
     {
+        struct page_info *page = mfn_to_page(old_base_mfn);
+
         if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(old_base_mfn));
+            put_page(page);
         else
-            put_page_and_type(mfn_to_page(old_base_mfn));
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+                rc = -EAGAIN;
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
     }
 
-    return 1;
+    return rc;
 }
 
 static struct domain *get_pg_owner(domid_t domid)
@@ -3154,7 +3191,8 @@ long do_mmuext_op(
         }
 
         case MMUEXT_NEW_BASEPTR:
-            okay = new_guest_cr3(gmfn_to_mfn(d, op.arg1.mfn));
+            rc = new_guest_cr3(gmfn_to_mfn(d, op.arg1.mfn));
+            okay = !rc;
             break;
         
 #ifdef __x86_64__
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 5a48a2a..7e4e6b6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2317,8 +2317,15 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                 rc = new_guest_cr3(gmfn_to_mfn(v->domain, compat_cr3_to_pfn(*reg)));
 #endif
             domain_unlock(v->domain);
-            if ( rc == 0 ) /* not okay */
+            switch ( rc )
+            {
+            case 0:
+                break;
+            case -EAGAIN: /* retry after preemption */
+                goto skip;
+            default:      /* not okay */
                 goto fail;
+            }
             break;
 
         case 4: /* Write CR4 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY470-0003eg-3p; Fri, 03 May 2013 00:44:34 +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 1UY46y-0003eV-Sq
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:33 +0000
Received: from [85.158.143.99:36842] by server-3.bemta-4.messagelabs.com id
	07/B4-02015-07803815; Fri, 03 May 2013 00:44:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1367541869!21579769!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16742 invoked from network); 3 May 2013 00:44:30 -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;
	3 May 2013 00:44: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 1UY46v-0001zo-LQ
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY46t-0007VP-UK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:28 +0000
Date: Fri, 03 May 2013 00:44:27 +0000
Message-Id: <E1UY46t-0007VP-UK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make MMUEXT_NEW_USER_BASEPTR
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 210e61b80c29ef824f5fdc5946d6d876b8875fe3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:24:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:24:02 2013 +0200

    x86: make MMUEXT_NEW_USER_BASEPTR preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 918a5f17b447072b40780f4d03a3adc99ff0073b
    master date: 2013-05-02 16:36:44 +0200
---
 xen/arch/x86/mm.c |   38 ++++++++++++++++++++++++++++++++------
 1 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index cc6242e..b561a6f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3200,29 +3200,55 @@ long do_mmuext_op(
             unsigned long old_mfn, mfn;
 
             mfn = gmfn_to_mfn(d, op.arg1.mfn);
+            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
+            /*
+             * This is particularly important when getting restarted after the
+             * previous attempt got preempted in the put-old-MFN phase.
+             */
+            if ( old_mfn == mfn )
+                break;
+
             if ( mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
                     okay = get_page_from_pagenr(mfn, d);
                 else
-                    okay = !get_page_and_type_from_pagenr(
-                        mfn, PGT_root_page_table, d, 0, 0);
+                {
+                    rc = get_page_and_type_from_pagenr(
+                        mfn, PGT_root_page_table, d, 0, 1);
+                    okay = !rc;
+                }
                 if ( unlikely(!okay) )
                 {
-                    MEM_LOG("Error while installing new mfn %lx", mfn);
+                    if ( rc == -EINTR )
+                        rc = -EAGAIN;
+                    else if ( rc != -EAGAIN )
+                        MEM_LOG("Error while installing new mfn %lx", mfn);
                     break;
                 }
             }
 
-            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
             curr->arch.guest_table_user = pagetable_from_pfn(mfn);
 
             if ( old_mfn != 0 )
             {
+                struct page_info *page = mfn_to_page(old_mfn);
+
                 if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(old_mfn));
+                    put_page(page);
                 else
-                    put_page_and_type(mfn_to_page(old_mfn));
+                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    {
+                    case -EINTR:
+                        rc = -EAGAIN;
+                    case -EAGAIN:
+                        curr->arch.old_guest_table = page;
+                        okay = 0;
+                        break;
+                    default:
+                        BUG_ON(rc);
+                        break;
+                    }
             }
 
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY470-0003eg-3p; Fri, 03 May 2013 00:44:34 +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 1UY46y-0003eV-Sq
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:33 +0000
Received: from [85.158.143.99:36842] by server-3.bemta-4.messagelabs.com id
	07/B4-02015-07803815; Fri, 03 May 2013 00:44:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1367541869!21579769!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16742 invoked from network); 3 May 2013 00:44:30 -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;
	3 May 2013 00:44: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 1UY46v-0001zo-LQ
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY46t-0007VP-UK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:28 +0000
Date: Fri, 03 May 2013 00:44:27 +0000
Message-Id: <E1UY46t-0007VP-UK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make MMUEXT_NEW_USER_BASEPTR
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 210e61b80c29ef824f5fdc5946d6d876b8875fe3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:24:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:24:02 2013 +0200

    x86: make MMUEXT_NEW_USER_BASEPTR preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 918a5f17b447072b40780f4d03a3adc99ff0073b
    master date: 2013-05-02 16:36:44 +0200
---
 xen/arch/x86/mm.c |   38 ++++++++++++++++++++++++++++++++------
 1 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index cc6242e..b561a6f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3200,29 +3200,55 @@ long do_mmuext_op(
             unsigned long old_mfn, mfn;
 
             mfn = gmfn_to_mfn(d, op.arg1.mfn);
+            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
+            /*
+             * This is particularly important when getting restarted after the
+             * previous attempt got preempted in the put-old-MFN phase.
+             */
+            if ( old_mfn == mfn )
+                break;
+
             if ( mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
                     okay = get_page_from_pagenr(mfn, d);
                 else
-                    okay = !get_page_and_type_from_pagenr(
-                        mfn, PGT_root_page_table, d, 0, 0);
+                {
+                    rc = get_page_and_type_from_pagenr(
+                        mfn, PGT_root_page_table, d, 0, 1);
+                    okay = !rc;
+                }
                 if ( unlikely(!okay) )
                 {
-                    MEM_LOG("Error while installing new mfn %lx", mfn);
+                    if ( rc == -EINTR )
+                        rc = -EAGAIN;
+                    else if ( rc != -EAGAIN )
+                        MEM_LOG("Error while installing new mfn %lx", mfn);
                     break;
                 }
             }
 
-            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
             curr->arch.guest_table_user = pagetable_from_pfn(mfn);
 
             if ( old_mfn != 0 )
             {
+                struct page_info *page = mfn_to_page(old_mfn);
+
                 if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(old_mfn));
+                    put_page(page);
                 else
-                    put_page_and_type(mfn_to_page(old_mfn));
+                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    {
+                    case -EINTR:
+                        rc = -EAGAIN;
+                    case -EAGAIN:
+                        curr->arch.old_guest_table = page;
+                        okay = 0;
+                        break;
+                    default:
+                        BUG_ON(rc);
+                        break;
+                    }
             }
 
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY47A-0003fx-78; Fri, 03 May 2013 00:44:44 +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 1UY478-0003fj-PS
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:43 +0000
Received: from [85.158.143.99:37074] by server-2.bemta-4.messagelabs.com id
	AF/FA-27124-A7803815; Fri, 03 May 2013 00:44:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367541880!27826116!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3643 invoked from network); 3 May 2013 00:44:41 -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;
	3 May 2013 00:44: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 1UY475-0001zu-U3
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY475-0007Vp-Sl
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:39 +0000
Date: Fri, 03 May 2013 00:44:39 +0000
Message-Id: <E1UY475-0007Vp-Sl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make vcpu_reset() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c6fad967aabeb98da8307e59f73474b23b42f0d1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:24:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:24:38 2013 +0200

    x86: make vcpu_reset() preemptible
    
    ... as dropping the old page tables may take significant amounts of
    time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 4939f9a6dee4280f38730fd3066e5dce353112f6
    master date: 2013-05-02 16:37:24 +0200
---
 xen/arch/x86/domain.c     |   13 ++++++-------
 xen/arch/x86/hvm/hvm.c    |    5 ++++-
 xen/arch/x86/hvm/vlapic.c |    5 ++++-
 xen/arch/x86/mm.c         |    6 +++---
 xen/common/domain.c       |   12 ++++++++++--
 xen/common/domctl.c       |    6 ++++--
 xen/include/asm-x86/mm.h  |    2 +-
 xen/include/xen/domain.h  |    4 ++--
 xen/include/xen/sched.h   |    3 +++
 9 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4b79db0..696eff3 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -902,17 +902,16 @@ int arch_set_info_guest(
 #undef c
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v, 0);
-    }
-    else
-    {
-        vcpu_end_shutdown_deferral(v);
+        return vcpu_destroy_pagetables(v);
     }
+
+    vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 /* 
@@ -1933,7 +1932,7 @@ int domain_relinquish_resources(struct domain *d)
         for_each_vcpu ( d, v )
         {
             /* Drop the in-use references to page-table bases. */
-            ret = vcpu_destroy_pagetables(v, 1);
+            ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9f53728..140e70c 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3083,8 +3083,11 @@ static void hvm_s3_suspend(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
+        int rc;
+
         vlapic_reset(vcpu_vlapic(v));
-        vcpu_reset(v);
+        rc = vcpu_reset(v);
+        ASSERT(!rc);
     }
 
     vpic_reset(d);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 09baf8d..a2ec9ae 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -252,10 +252,13 @@ static void vlapic_init_sipi_action(unsigned long _vcpu)
     {
     case APIC_DM_INIT: {
         bool_t fpu_initialised;
+        int rc;
+
         domain_lock(target->domain);
         /* Reset necessary VCPU state. This does not include FPU state. */
         fpu_initialised = target->fpu_initialised;
-        vcpu_reset(target);
+        rc = vcpu_reset(target);
+        ASSERT(!rc);
         target->fpu_initialised = fpu_initialised;
         vlapic_reset(vcpu_vlapic(target));
         domain_unlock(target->domain);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b561a6f..2567c5e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2744,7 +2744,7 @@ static int put_old_guest_table(struct vcpu *v)
     return rc;
 }
 
-int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+int vcpu_destroy_pagetables(struct vcpu *v)
 {
     unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
     struct page_info *page;
@@ -2764,7 +2764,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, preemptible);
+            rc = put_page_and_type_preemptible(page, 1);
     }
 
 #ifdef __x86_64__
@@ -2790,7 +2790,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, preemptible);
+                rc = put_page_and_type_preemptible(page, 1);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 054f7c4..4f2efe5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -770,14 +770,18 @@ int boot_vcpu(struct domain *d, int vcpuid, vcpu_guest_context_u ctxt)
     return arch_set_info_guest(v, ctxt);
 }
 
-void vcpu_reset(struct vcpu *v)
+int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    int rc;
 
     vcpu_pause(v);
     domain_lock(d);
 
-    arch_vcpu_reset(v);
+    set_bit(_VPF_in_reset, &v->pause_flags);
+    rc = arch_vcpu_reset(v);
+    if ( rc )
+        goto out_unlock;
 
     set_bit(_VPF_down, &v->pause_flags);
 
@@ -793,9 +797,13 @@ void vcpu_reset(struct vcpu *v)
 #endif
     cpus_clear(v->cpu_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
+ out_unlock:
     domain_unlock(v->domain);
     vcpu_unpause(v);
+
+    return rc;
 }
 
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index d9a1f53..65e30df 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -286,8 +286,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 
         if ( guest_handle_is_null(op->u.vcpucontext.ctxt) )
         {
-            vcpu_reset(v);
-            ret = 0;
+            ret = vcpu_reset(v);
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
             goto svc_out;
         }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index d24e132..ecf93c2 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,7 +555,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
-int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
+int vcpu_destroy_pagetables(struct vcpu *);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index edffd1f..5175ef7 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -15,7 +15,7 @@ struct vcpu *alloc_vcpu(
 int boot_vcpu(
     struct domain *d, int vcpuid, vcpu_guest_context_u ctxt);
 struct vcpu *alloc_dom0_vcpu0(void);
-void vcpu_reset(struct vcpu *v);
+int vcpu_reset(struct vcpu *);
 
 struct xen_domctl_getdomaininfo;
 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
@@ -57,7 +57,7 @@ void arch_dump_vcpu_info(struct vcpu *v);
 
 void arch_dump_domain_info(struct domain *d);
 
-void arch_vcpu_reset(struct vcpu *v);
+int arch_vcpu_reset(struct vcpu *);
 
 bool_t domctl_lock_acquire(void);
 void domctl_lock_release(void);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 5909d9a..16e50e1 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -597,6 +597,9 @@ extern struct domain *domain_list;
  /* VCPU is blocked on memory-event ring. */
 #define _VPF_mem_event       4
 #define VPF_mem_event        (1UL<<_VPF_mem_event)
+ /* VCPU is being reset. */
+#define _VPF_in_reset        7
+#define VPF_in_reset         (1UL<<_VPF_in_reset)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY47A-0003fx-78; Fri, 03 May 2013 00:44:44 +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 1UY478-0003fj-PS
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:43 +0000
Received: from [85.158.143.99:37074] by server-2.bemta-4.messagelabs.com id
	AF/FA-27124-A7803815; Fri, 03 May 2013 00:44:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367541880!27826116!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3643 invoked from network); 3 May 2013 00:44:41 -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;
	3 May 2013 00:44: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 1UY475-0001zu-U3
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY475-0007Vp-Sl
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:39 +0000
Date: Fri, 03 May 2013 00:44:39 +0000
Message-Id: <E1UY475-0007Vp-Sl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make vcpu_reset() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c6fad967aabeb98da8307e59f73474b23b42f0d1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:24:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:24:38 2013 +0200

    x86: make vcpu_reset() preemptible
    
    ... as dropping the old page tables may take significant amounts of
    time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 4939f9a6dee4280f38730fd3066e5dce353112f6
    master date: 2013-05-02 16:37:24 +0200
---
 xen/arch/x86/domain.c     |   13 ++++++-------
 xen/arch/x86/hvm/hvm.c    |    5 ++++-
 xen/arch/x86/hvm/vlapic.c |    5 ++++-
 xen/arch/x86/mm.c         |    6 +++---
 xen/common/domain.c       |   12 ++++++++++--
 xen/common/domctl.c       |    6 ++++--
 xen/include/asm-x86/mm.h  |    2 +-
 xen/include/xen/domain.h  |    4 ++--
 xen/include/xen/sched.h   |    3 +++
 9 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4b79db0..696eff3 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -902,17 +902,16 @@ int arch_set_info_guest(
 #undef c
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v, 0);
-    }
-    else
-    {
-        vcpu_end_shutdown_deferral(v);
+        return vcpu_destroy_pagetables(v);
     }
+
+    vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 /* 
@@ -1933,7 +1932,7 @@ int domain_relinquish_resources(struct domain *d)
         for_each_vcpu ( d, v )
         {
             /* Drop the in-use references to page-table bases. */
-            ret = vcpu_destroy_pagetables(v, 1);
+            ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9f53728..140e70c 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3083,8 +3083,11 @@ static void hvm_s3_suspend(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
+        int rc;
+
         vlapic_reset(vcpu_vlapic(v));
-        vcpu_reset(v);
+        rc = vcpu_reset(v);
+        ASSERT(!rc);
     }
 
     vpic_reset(d);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 09baf8d..a2ec9ae 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -252,10 +252,13 @@ static void vlapic_init_sipi_action(unsigned long _vcpu)
     {
     case APIC_DM_INIT: {
         bool_t fpu_initialised;
+        int rc;
+
         domain_lock(target->domain);
         /* Reset necessary VCPU state. This does not include FPU state. */
         fpu_initialised = target->fpu_initialised;
-        vcpu_reset(target);
+        rc = vcpu_reset(target);
+        ASSERT(!rc);
         target->fpu_initialised = fpu_initialised;
         vlapic_reset(vcpu_vlapic(target));
         domain_unlock(target->domain);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b561a6f..2567c5e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2744,7 +2744,7 @@ static int put_old_guest_table(struct vcpu *v)
     return rc;
 }
 
-int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+int vcpu_destroy_pagetables(struct vcpu *v)
 {
     unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
     struct page_info *page;
@@ -2764,7 +2764,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, preemptible);
+            rc = put_page_and_type_preemptible(page, 1);
     }
 
 #ifdef __x86_64__
@@ -2790,7 +2790,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, preemptible);
+                rc = put_page_and_type_preemptible(page, 1);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 054f7c4..4f2efe5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -770,14 +770,18 @@ int boot_vcpu(struct domain *d, int vcpuid, vcpu_guest_context_u ctxt)
     return arch_set_info_guest(v, ctxt);
 }
 
-void vcpu_reset(struct vcpu *v)
+int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    int rc;
 
     vcpu_pause(v);
     domain_lock(d);
 
-    arch_vcpu_reset(v);
+    set_bit(_VPF_in_reset, &v->pause_flags);
+    rc = arch_vcpu_reset(v);
+    if ( rc )
+        goto out_unlock;
 
     set_bit(_VPF_down, &v->pause_flags);
 
@@ -793,9 +797,13 @@ void vcpu_reset(struct vcpu *v)
 #endif
     cpus_clear(v->cpu_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
+ out_unlock:
     domain_unlock(v->domain);
     vcpu_unpause(v);
+
+    return rc;
 }
 
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index d9a1f53..65e30df 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -286,8 +286,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 
         if ( guest_handle_is_null(op->u.vcpucontext.ctxt) )
         {
-            vcpu_reset(v);
-            ret = 0;
+            ret = vcpu_reset(v);
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
             goto svc_out;
         }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index d24e132..ecf93c2 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,7 +555,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
-int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
+int vcpu_destroy_pagetables(struct vcpu *);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index edffd1f..5175ef7 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -15,7 +15,7 @@ struct vcpu *alloc_vcpu(
 int boot_vcpu(
     struct domain *d, int vcpuid, vcpu_guest_context_u ctxt);
 struct vcpu *alloc_dom0_vcpu0(void);
-void vcpu_reset(struct vcpu *v);
+int vcpu_reset(struct vcpu *);
 
 struct xen_domctl_getdomaininfo;
 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
@@ -57,7 +57,7 @@ void arch_dump_vcpu_info(struct vcpu *v);
 
 void arch_dump_domain_info(struct domain *d);
 
-void arch_vcpu_reset(struct vcpu *v);
+int arch_vcpu_reset(struct vcpu *);
 
 bool_t domctl_lock_acquire(void);
 void domctl_lock_release(void);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 5909d9a..16e50e1 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -597,6 +597,9 @@ extern struct domain *domain_list;
  /* VCPU is blocked on memory-event ring. */
 #define _VPF_mem_event       4
 #define VPF_mem_event        (1UL<<_VPF_mem_event)
+ /* VCPU is being reset. */
+#define _VPF_in_reset        7
+#define VPF_in_reset         (1UL<<_VPF_in_reset)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:57 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY47K-0003ho-Ca; Fri, 03 May 2013 00:44: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 1UY47J-0003hU-PQ
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:54 +0000
Received: from [85.158.139.211:22419] by server-4.bemta-5.messagelabs.com id
	00/42-12332-58803815; Fri, 03 May 2013 00:44:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1367541891!21539362!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20337 invoked from network); 3 May 2013 00:44:52 -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;
	3 May 2013 00:44: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 1UY47G-000200-Uu
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47G-0007Wh-2m
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:50 +0000
Date: Fri, 03 May 2013 00:44:50 +0000
Message-Id: <E1UY47G-0007Wh-2m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make arch_set_info_guest()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 02615aaefd5c6c5856b4f81799bb6ec1ca0d89d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:25:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:25:37 2013 +0200

    x86: make arch_set_info_guest() preemptible
    
    .. as the root page table validation (and the dropping of an eventual
    old one) can require meaningful amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 99d2b149915010e986f4d8778708c5891e7b4635
    master date: 2013-05-02 16:38:30 +0200
---
 xen/arch/x86/domain.c      |  108 ++++++++++++++++++++++++++++---------------
 xen/common/compat/domain.c |    4 ++
 xen/common/domain.c        |    5 ++
 xen/common/domctl.c        |    4 ++
 4 files changed, 83 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 696eff3..9a34488 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -676,6 +676,7 @@ int arch_set_info_guest(
 {
     struct domain *d = v->domain;
     unsigned long cr3_pfn = INVALID_MFN;
+    struct page_info *cr3_page;
     unsigned long flags, cr4;
     int i, rc = 0, compat;
 
@@ -815,72 +816,103 @@ int arch_set_info_guest(
     if ( rc != 0 )
         return rc;
 
+    set_bit(_VPF_in_reset, &v->pause_flags);
+
     if ( !compat )
-    {
         cr3_pfn = gmfn_to_mfn(d, xen_cr3_to_pfn(c.nat->ctrlreg[3]));
+#ifdef __x86_64__
+    else
+        cr3_pfn = gmfn_to_mfn(d, compat_cr3_to_pfn(c.cmp->ctrlreg[3]));
+#endif
+    cr3_page = mfn_to_page(cr3_pfn);
 
-        if ( !mfn_valid(cr3_pfn) ||
-             (paging_mode_refcounts(d)
-              ? !get_page(mfn_to_page(cr3_pfn), d)
-              : !get_page_and_type(mfn_to_page(cr3_pfn), d,
-                                   PGT_base_page_table)) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
+    if ( !mfn_valid(cr3_pfn) || !get_page(cr3_page, d) )
+    {
+        cr3_page = NULL;
+        rc = -EINVAL;
+    }
+    else if ( paging_mode_refcounts(d) )
+        /* nothing */;
+    else if ( cr3_page == v->arch.old_guest_table )
+    {
+        v->arch.old_guest_table = NULL;
+        put_page(cr3_page);
+    }
+    else
+    {
+        /*
+         * Since v->arch.guest_table{,_user} are both NULL, this effectively
+         * is just a call to put_old_guest_table().
+         */
+        if ( !compat )
+            rc = vcpu_destroy_pagetables(v);
+        if ( !rc )
+            rc = get_page_type_preemptible(cr3_page,
+                                           !compat ? PGT_root_page_table
+                                                   : PGT_l3_page_table);
+        if ( rc == -EINTR )
+            rc = -EAGAIN;
+    }
 
+    if ( rc )
+        /* handled below */;
+    else if ( !compat )
+    {
         v->arch.guest_table = pagetable_from_pfn(cr3_pfn);
 
 #ifdef __x86_64__
         if ( c.nat->ctrlreg[1] )
         {
             cr3_pfn = gmfn_to_mfn(d, xen_cr3_to_pfn(c.nat->ctrlreg[1]));
+            cr3_page = mfn_to_page(cr3_pfn);
 
-            if ( !mfn_valid(cr3_pfn) ||
-                 (paging_mode_refcounts(d)
-                  ? !get_page(mfn_to_page(cr3_pfn), d)
-                  : !get_page_and_type(mfn_to_page(cr3_pfn), d,
-                                       PGT_base_page_table)) )
+            if ( !mfn_valid(cr3_pfn) || !get_page(cr3_page, d) )
             {
-                cr3_pfn = pagetable_get_pfn(v->arch.guest_table);
-                v->arch.guest_table = pagetable_null();
-                if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(cr3_pfn));
-                else
-                    put_page_and_type(mfn_to_page(cr3_pfn));
-                destroy_gdt(v);
-                return -EINVAL;
+                cr3_page = NULL;
+                rc = -EINVAL;
+            }
+            else if ( !paging_mode_refcounts(d) )
+            {
+                rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
+                switch ( rc )
+                {
+                case -EINTR:
+                    rc = -EAGAIN;
+                case -EAGAIN:
+                    v->arch.old_guest_table =
+                        pagetable_get_page(v->arch.guest_table);
+                    v->arch.guest_table = pagetable_null();
+                    break;
+                }
             }
 
-            v->arch.guest_table_user = pagetable_from_pfn(cr3_pfn);
+            if ( !rc )
+                v->arch.guest_table_user = pagetable_from_pfn(cr3_pfn);
         }
         else if ( !(flags & VGCF_in_kernel) )
         {
-            destroy_gdt(v);
-            return -EINVAL;
+            cr3_page = NULL;
+            rc = -EINVAL;
         }
     }
     else
     {
         l4_pgentry_t *l4tab;
 
-        cr3_pfn = gmfn_to_mfn(d, compat_cr3_to_pfn(c.cmp->ctrlreg[3]));
-
-        if ( !mfn_valid(cr3_pfn) ||
-             (paging_mode_refcounts(d)
-              ? !get_page(mfn_to_page(cr3_pfn), d)
-              : !get_page_and_type(mfn_to_page(cr3_pfn), d,
-                                   PGT_l3_page_table)) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
         l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
         *l4tab = l4e_from_pfn(
             cr3_pfn, _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
 #endif
     }
+    if ( rc )
+    {
+        if ( cr3_page )
+            put_page(cr3_page);
+        destroy_gdt(v);
+        return rc;
+    }
+
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
     if ( v->vcpu_id == 0 )
         update_domain_wallclock_time(d);
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 67e0e5e..5fe393f 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -52,6 +52,10 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
             rc = boot_vcpu(d, vcpuid, cmp_ctxt);
         domain_unlock(d);
 
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         xfree(cmp_ctxt);
         break;
     }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 4f2efe5..5fa045b 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -842,6 +842,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
         domain_unlock(d);
 
         xfree(ctxt);
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         break;
 
     case VCPUOP_up:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 65e30df..c3240db 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -318,6 +318,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
             domain_pause(d);
             ret = arch_set_info_guest(v, c);
             domain_unpause(d);
+
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
         }
 
     svc_out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:44:57 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:44: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 1UY47K-0003ho-Ca; Fri, 03 May 2013 00:44: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 1UY47J-0003hU-PQ
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:54 +0000
Received: from [85.158.139.211:22419] by server-4.bemta-5.messagelabs.com id
	00/42-12332-58803815; Fri, 03 May 2013 00:44:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1367541891!21539362!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20337 invoked from network); 3 May 2013 00:44:52 -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;
	3 May 2013 00:44: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 1UY47G-000200-Uu
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47G-0007Wh-2m
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:44:50 +0000
Date: Fri, 03 May 2013 00:44:50 +0000
Message-Id: <E1UY47G-0007Wh-2m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make arch_set_info_guest()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 02615aaefd5c6c5856b4f81799bb6ec1ca0d89d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:25:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:25:37 2013 +0200

    x86: make arch_set_info_guest() preemptible
    
    .. as the root page table validation (and the dropping of an eventual
    old one) can require meaningful amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 99d2b149915010e986f4d8778708c5891e7b4635
    master date: 2013-05-02 16:38:30 +0200
---
 xen/arch/x86/domain.c      |  108 ++++++++++++++++++++++++++++---------------
 xen/common/compat/domain.c |    4 ++
 xen/common/domain.c        |    5 ++
 xen/common/domctl.c        |    4 ++
 4 files changed, 83 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 696eff3..9a34488 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -676,6 +676,7 @@ int arch_set_info_guest(
 {
     struct domain *d = v->domain;
     unsigned long cr3_pfn = INVALID_MFN;
+    struct page_info *cr3_page;
     unsigned long flags, cr4;
     int i, rc = 0, compat;
 
@@ -815,72 +816,103 @@ int arch_set_info_guest(
     if ( rc != 0 )
         return rc;
 
+    set_bit(_VPF_in_reset, &v->pause_flags);
+
     if ( !compat )
-    {
         cr3_pfn = gmfn_to_mfn(d, xen_cr3_to_pfn(c.nat->ctrlreg[3]));
+#ifdef __x86_64__
+    else
+        cr3_pfn = gmfn_to_mfn(d, compat_cr3_to_pfn(c.cmp->ctrlreg[3]));
+#endif
+    cr3_page = mfn_to_page(cr3_pfn);
 
-        if ( !mfn_valid(cr3_pfn) ||
-             (paging_mode_refcounts(d)
-              ? !get_page(mfn_to_page(cr3_pfn), d)
-              : !get_page_and_type(mfn_to_page(cr3_pfn), d,
-                                   PGT_base_page_table)) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
+    if ( !mfn_valid(cr3_pfn) || !get_page(cr3_page, d) )
+    {
+        cr3_page = NULL;
+        rc = -EINVAL;
+    }
+    else if ( paging_mode_refcounts(d) )
+        /* nothing */;
+    else if ( cr3_page == v->arch.old_guest_table )
+    {
+        v->arch.old_guest_table = NULL;
+        put_page(cr3_page);
+    }
+    else
+    {
+        /*
+         * Since v->arch.guest_table{,_user} are both NULL, this effectively
+         * is just a call to put_old_guest_table().
+         */
+        if ( !compat )
+            rc = vcpu_destroy_pagetables(v);
+        if ( !rc )
+            rc = get_page_type_preemptible(cr3_page,
+                                           !compat ? PGT_root_page_table
+                                                   : PGT_l3_page_table);
+        if ( rc == -EINTR )
+            rc = -EAGAIN;
+    }
 
+    if ( rc )
+        /* handled below */;
+    else if ( !compat )
+    {
         v->arch.guest_table = pagetable_from_pfn(cr3_pfn);
 
 #ifdef __x86_64__
         if ( c.nat->ctrlreg[1] )
         {
             cr3_pfn = gmfn_to_mfn(d, xen_cr3_to_pfn(c.nat->ctrlreg[1]));
+            cr3_page = mfn_to_page(cr3_pfn);
 
-            if ( !mfn_valid(cr3_pfn) ||
-                 (paging_mode_refcounts(d)
-                  ? !get_page(mfn_to_page(cr3_pfn), d)
-                  : !get_page_and_type(mfn_to_page(cr3_pfn), d,
-                                       PGT_base_page_table)) )
+            if ( !mfn_valid(cr3_pfn) || !get_page(cr3_page, d) )
             {
-                cr3_pfn = pagetable_get_pfn(v->arch.guest_table);
-                v->arch.guest_table = pagetable_null();
-                if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(cr3_pfn));
-                else
-                    put_page_and_type(mfn_to_page(cr3_pfn));
-                destroy_gdt(v);
-                return -EINVAL;
+                cr3_page = NULL;
+                rc = -EINVAL;
+            }
+            else if ( !paging_mode_refcounts(d) )
+            {
+                rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
+                switch ( rc )
+                {
+                case -EINTR:
+                    rc = -EAGAIN;
+                case -EAGAIN:
+                    v->arch.old_guest_table =
+                        pagetable_get_page(v->arch.guest_table);
+                    v->arch.guest_table = pagetable_null();
+                    break;
+                }
             }
 
-            v->arch.guest_table_user = pagetable_from_pfn(cr3_pfn);
+            if ( !rc )
+                v->arch.guest_table_user = pagetable_from_pfn(cr3_pfn);
         }
         else if ( !(flags & VGCF_in_kernel) )
         {
-            destroy_gdt(v);
-            return -EINVAL;
+            cr3_page = NULL;
+            rc = -EINVAL;
         }
     }
     else
     {
         l4_pgentry_t *l4tab;
 
-        cr3_pfn = gmfn_to_mfn(d, compat_cr3_to_pfn(c.cmp->ctrlreg[3]));
-
-        if ( !mfn_valid(cr3_pfn) ||
-             (paging_mode_refcounts(d)
-              ? !get_page(mfn_to_page(cr3_pfn), d)
-              : !get_page_and_type(mfn_to_page(cr3_pfn), d,
-                                   PGT_l3_page_table)) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
         l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
         *l4tab = l4e_from_pfn(
             cr3_pfn, _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
 #endif
     }
+    if ( rc )
+    {
+        if ( cr3_page )
+            put_page(cr3_page);
+        destroy_gdt(v);
+        return rc;
+    }
+
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
     if ( v->vcpu_id == 0 )
         update_domain_wallclock_time(d);
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 67e0e5e..5fe393f 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -52,6 +52,10 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
             rc = boot_vcpu(d, vcpuid, cmp_ctxt);
         domain_unlock(d);
 
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         xfree(cmp_ctxt);
         break;
     }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 4f2efe5..5fa045b 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -842,6 +842,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
         domain_unlock(d);
 
         xfree(ctxt);
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         break;
 
     case VCPUOP_up:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 65e30df..c3240db 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -318,6 +318,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
             domain_pause(d);
             ret = arch_set_info_guest(v, c);
             domain_unpause(d);
+
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
         }
 
     svc_out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:45:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:45:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UY47V-0003js-GB; Fri, 03 May 2013 00:45:05 +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 1UY47U-0003jY-D5
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:04 +0000
Received: from [193.109.254.147:43960] by server-11.bemta-14.messagelabs.com
	id 22/F4-24840-F8803815; Fri, 03 May 2013 00:45:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1367541901!6185196!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18879 invoked from network); 3 May 2013 00:45:02 -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;
	3 May 2013 00:45:02 -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 1UY47R-000214-5h
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47R-0007X4-3A
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:01 +0000
Date: Fri, 03 May 2013 00:45:01 +0000
Message-Id: <E1UY47R-0007X4-3A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make page table unpinning
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 09f9f72fa3dc2e239359741596fa349d8461cb50
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:26:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:26:13 2013 +0200

    x86: make page table unpinning preemptible
    
    ... as it may take significant amounts of time.
    
    Since we can't re-invoke the operation in a second attempt, the
    continuation logic must be slightly tweaked so that we make sure
    do_mmuext_op() gets run one more time even when the preempted unpin
    operation was the last one in a batch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: a3e049f8e86fe18e3b87f18dc0c7be665026fd9f
    master date: 2013-05-02 16:39:06 +0200
---
 xen/arch/x86/mm.c               |   40 +++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |   23 +++++++++++++++++----
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2567c5e..9c3d251 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3040,6 +3040,14 @@ long do_mmuext_op(
         return rc;
     }
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(uops)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
+
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
         count &= ~MMU_UPDATE_PREEMPTED;
@@ -3063,7 +3071,7 @@ long do_mmuext_op(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3181,7 +3189,17 @@ long do_mmuext_op(
                 break;
             }
 
-            put_page_and_type(page);
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                rc = 0;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
             put_page(page);
 
             /* A page is dirtied when its pin status is cleared. */
@@ -3487,9 +3505,27 @@ long do_mmuext_op(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmuext_op, "hihi",
             uops, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmuext_op, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 7b6ad6d..6ad41d4 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -222,6 +222,13 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
     int rc = 0;
     XEN_GUEST_HANDLE(mmuext_op_t) nat_ops;
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(cmp_uops)) )
+    {
+        set_xen_guest_handle(nat_ops, NULL);
+        return do_mmuext_op(nat_ops, count, pdone, foreigndom);
+    }
+
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
 
@@ -324,12 +331,18 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
                 left = 1;
-                BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops, cmp_uops));
-                BUG_ON(left != arg1);
-                if (!test_bit(_MCSF_in_multicall, &mcs->flags))
-                    regs->_ecx += count - i;
+                if ( arg1 != MMU_UPDATE_PREEMPTED )
+                {
+                    BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops,
+                                                        cmp_uops));
+                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                        regs->_ecx += count - i;
+                    else
+                        mcs->compat_call.args[1] += count - i;
+                }
                 else
-                    mcs->compat_call.args[1] += count - i;
+                    BUG_ON(hypercall_xlat_continuation(&left, 0));
+                BUG_ON(left != arg1);
             }
             else
                 BUG_ON(err > 0);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:45:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:45:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UY47V-0003js-GB; Fri, 03 May 2013 00:45:05 +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 1UY47U-0003jY-D5
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:04 +0000
Received: from [193.109.254.147:43960] by server-11.bemta-14.messagelabs.com
	id 22/F4-24840-F8803815; Fri, 03 May 2013 00:45:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1367541901!6185196!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18879 invoked from network); 3 May 2013 00:45:02 -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;
	3 May 2013 00:45:02 -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 1UY47R-000214-5h
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47R-0007X4-3A
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:01 +0000
Date: Fri, 03 May 2013 00:45:01 +0000
Message-Id: <E1UY47R-0007X4-3A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make page table unpinning
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 09f9f72fa3dc2e239359741596fa349d8461cb50
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:26:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:26:13 2013 +0200

    x86: make page table unpinning preemptible
    
    ... as it may take significant amounts of time.
    
    Since we can't re-invoke the operation in a second attempt, the
    continuation logic must be slightly tweaked so that we make sure
    do_mmuext_op() gets run one more time even when the preempted unpin
    operation was the last one in a batch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: a3e049f8e86fe18e3b87f18dc0c7be665026fd9f
    master date: 2013-05-02 16:39:06 +0200
---
 xen/arch/x86/mm.c               |   40 +++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |   23 +++++++++++++++++----
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2567c5e..9c3d251 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3040,6 +3040,14 @@ long do_mmuext_op(
         return rc;
     }
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(uops)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
+
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
         count &= ~MMU_UPDATE_PREEMPTED;
@@ -3063,7 +3071,7 @@ long do_mmuext_op(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3181,7 +3189,17 @@ long do_mmuext_op(
                 break;
             }
 
-            put_page_and_type(page);
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                rc = 0;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
             put_page(page);
 
             /* A page is dirtied when its pin status is cleared. */
@@ -3487,9 +3505,27 @@ long do_mmuext_op(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmuext_op, "hihi",
             uops, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmuext_op, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 7b6ad6d..6ad41d4 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -222,6 +222,13 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
     int rc = 0;
     XEN_GUEST_HANDLE(mmuext_op_t) nat_ops;
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(cmp_uops)) )
+    {
+        set_xen_guest_handle(nat_ops, NULL);
+        return do_mmuext_op(nat_ops, count, pdone, foreigndom);
+    }
+
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
 
@@ -324,12 +331,18 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
                 left = 1;
-                BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops, cmp_uops));
-                BUG_ON(left != arg1);
-                if (!test_bit(_MCSF_in_multicall, &mcs->flags))
-                    regs->_ecx += count - i;
+                if ( arg1 != MMU_UPDATE_PREEMPTED )
+                {
+                    BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops,
+                                                        cmp_uops));
+                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                        regs->_ecx += count - i;
+                    else
+                        mcs->compat_call.args[1] += count - i;
+                }
                 else
-                    mcs->compat_call.args[1] += count - i;
+                    BUG_ON(hypercall_xlat_continuation(&left, 0));
+                BUG_ON(left != arg1);
             }
             else
                 BUG_ON(err > 0);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:45:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:45: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 1UY47i-0003mF-JF; Fri, 03 May 2013 00:45:18 +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 1UY47h-0003lv-BQ
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:17 +0000
Received: from [85.158.139.83:51872] by server-12.bemta-5.messagelabs.com id
	B8/4A-16465-C9803815; Fri, 03 May 2013 00:45:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1367541914!23878144!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4247 invoked from network); 3 May 2013 00:45:15 -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;
	3 May 2013 00:45: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 1UY47d-00021D-RH
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47b-0007Xa-Hb
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:13 +0000
Date: Fri, 03 May 2013 00:45:11 +0000
Message-Id: <E1UY47b-0007Xa-Hb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make page table handling
	error paths preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8eb2e89bfad8d55d0ca770e2a0988c945b318e03
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:26:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:26:43 2013 +0200

    x86: make page table handling error paths preemptible
    
    ... as they may take significant amounts of time.
    
    This requires cloning the tweaked continuation logic from
    do_mmuext_op() to do_mmu_update().
    
    Note that in mod_l[34]_entry() a negative "preemptible" value gets
    passed to put_page_from_l[34]e() now, telling the callee to store the
    respective page in current->arch.old_guest_table (for a hypercall
    continuation to pick up), rather than carrying out the put right away.
    This is going to be made a little more explicit by a subsequent cleanup
    patch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b8efae696c9a2d46e91fa0eda739427efc16c250
    master date: 2013-05-02 16:39:37 +0200
---
 xen/arch/x86/mm.c |  125 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 98 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9c3d251..b7fc4cb 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1183,7 +1183,16 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
 #endif
 
     if ( unlikely(partial > 0) )
+    {
+        ASSERT(preemptible >= 0);
         return __put_page_type(l3e_get_page(l3e), preemptible);
+    }
+
+    if ( preemptible < 0 )
+    {
+        current->arch.old_guest_table = l3e_get_page(l3e);
+        return 0;
+    }
 
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
@@ -1196,7 +1205,17 @@ static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
          (l4e_get_pfn(l4e) != pfn) )
     {
         if ( unlikely(partial > 0) )
+        {
+            ASSERT(preemptible >= 0);
             return __put_page_type(l4e_get_page(l4e), preemptible);
+        }
+
+        if ( preemptible < 0 )
+        {
+            current->arch.old_guest_table = l4e_get_page(l4e);
+            return 0;
+        }
+
         return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
     }
     return 1;
@@ -1486,12 +1505,17 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
     if ( rc < 0 && rc != -EAGAIN && rc != -EINTR )
     {
         MEM_LOG("Failure in alloc_l3_table: entry %d", i);
+        if ( i )
+        {
+            page->nr_validated_ptes = i;
+            page->partial_pte = 0;
+            current->arch.old_guest_table = page;
+        }
         while ( i-- > 0 )
         {
             if ( !is_guest_l3_slot(i) )
                 continue;
             unadjust_guest_l3e(pl3e[i], d);
-            put_page_from_l3e(pl3e[i], pfn, 0, 0);
         }
     }
 
@@ -1521,22 +1545,24 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
             page->nr_validated_ptes = i;
             page->partial_pte = partial ?: 1;
         }
-        else if ( rc == -EINTR )
+        else if ( rc < 0 )
         {
+            if ( rc != -EINTR )
+                MEM_LOG("Failure in alloc_l4_table: entry %d", i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
                 page->partial_pte = 0;
-                rc = -EAGAIN;
+                if ( rc == -EINTR )
+                    rc = -EAGAIN;
+                else
+                {
+                    if ( current->arch.old_guest_table )
+                        page->nr_validated_ptes++;
+                    current->arch.old_guest_table = page;
+                }
             }
         }
-        else if ( rc < 0 )
-        {
-            MEM_LOG("Failure in alloc_l4_table: entry %d", i);
-            while ( i-- > 0 )
-                if ( is_guest_l4_slot(d, i) )
-                    put_page_from_l4e(pl4e[i], pfn, 0, 0);
-        }
         if ( rc < 0 )
             return rc;
 
@@ -1966,7 +1992,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, 0);
+    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2029,7 +2055,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, 0);
+    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2187,7 +2213,15 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
                 page_to_mfn(page), get_gpfn_from_mfn(page_to_mfn(page)),
                 type, page->count_info, page->u.inuse.type_info);
-        page->u.inuse.type_info = 0;
+        if ( page != current->arch.old_guest_table )
+            page->u.inuse.type_info = 0;
+        else
+        {
+            ASSERT((page->u.inuse.type_info &
+                    (PGT_count_mask | PGT_validated)) == 1);
+            get_page_light(page);
+            page->u.inuse.type_info |= PGT_partial;
+        }
     }
     else
     {
@@ -3131,21 +3165,17 @@ long do_mmuext_op(
             page = mfn_to_page(mfn);
 
             if ( (rc = xsm_memory_pin_page(d, page)) != 0 )
-            {
-                put_page_and_type(page);
                 okay = 0;
-                break;
-            }
-
-            if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                           &page->u.inuse.type_info)) )
+            else if ( unlikely(test_and_set_bit(_PGT_pinned,
+                                                &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", mfn);
-                put_page_and_type(page);
                 okay = 0;
-                break;
             }
 
+            if ( unlikely(!okay) )
+                goto pin_drop;
+
             /* A page is dirtied when its pin status is set. */
             paging_mark_dirty(pg_owner, mfn);
            
@@ -3159,7 +3189,13 @@ long do_mmuext_op(
                                                &page->u.inuse.type_info));
                 spin_unlock(&pg_owner->page_alloc_lock);
                 if ( drop_ref )
-                    put_page_and_type(page);
+                {
+        pin_drop:
+                    if ( type == PGT_l1_page_table )
+                        put_page_and_type(page);
+                    else
+                        curr->arch.old_guest_table = page;
+                }
             }
 
             break;
@@ -3552,11 +3588,28 @@ long do_mmu_update(
     void *va;
     unsigned long gpfn, gmfn, mfn;
     struct page_info *page;
-    int rc = 0, okay = 1, i = 0;
-    unsigned int cmd, done = 0, pt_dom;
-    struct vcpu *v = current;
+    unsigned int cmd, i = 0, done = 0, pt_dom;
+    struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    int rc = put_old_guest_table(curr), okay = 1;
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmu_update, "hihi", ureqs, count, pdone,
+                     foreigndom);
+        return rc;
+    }
+
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(ureqs)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3605,7 +3658,7 @@ long do_mmu_update(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3870,9 +3923,27 @@ long do_mmu_update(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmu_update, "hihi",
             ureqs, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmu_update, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:45:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:45: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 1UY47i-0003mF-JF; Fri, 03 May 2013 00:45:18 +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 1UY47h-0003lv-BQ
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:17 +0000
Received: from [85.158.139.83:51872] by server-12.bemta-5.messagelabs.com id
	B8/4A-16465-C9803815; Fri, 03 May 2013 00:45:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1367541914!23878144!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4247 invoked from network); 3 May 2013 00:45:15 -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;
	3 May 2013 00:45: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 1UY47d-00021D-RH
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47b-0007Xa-Hb
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:13 +0000
Date: Fri, 03 May 2013 00:45:11 +0000
Message-Id: <E1UY47b-0007Xa-Hb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: make page table handling
	error paths preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8eb2e89bfad8d55d0ca770e2a0988c945b318e03
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:26:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:26:43 2013 +0200

    x86: make page table handling error paths preemptible
    
    ... as they may take significant amounts of time.
    
    This requires cloning the tweaked continuation logic from
    do_mmuext_op() to do_mmu_update().
    
    Note that in mod_l[34]_entry() a negative "preemptible" value gets
    passed to put_page_from_l[34]e() now, telling the callee to store the
    respective page in current->arch.old_guest_table (for a hypercall
    continuation to pick up), rather than carrying out the put right away.
    This is going to be made a little more explicit by a subsequent cleanup
    patch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b8efae696c9a2d46e91fa0eda739427efc16c250
    master date: 2013-05-02 16:39:37 +0200
---
 xen/arch/x86/mm.c |  125 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 98 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9c3d251..b7fc4cb 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1183,7 +1183,16 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
 #endif
 
     if ( unlikely(partial > 0) )
+    {
+        ASSERT(preemptible >= 0);
         return __put_page_type(l3e_get_page(l3e), preemptible);
+    }
+
+    if ( preemptible < 0 )
+    {
+        current->arch.old_guest_table = l3e_get_page(l3e);
+        return 0;
+    }
 
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
@@ -1196,7 +1205,17 @@ static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
          (l4e_get_pfn(l4e) != pfn) )
     {
         if ( unlikely(partial > 0) )
+        {
+            ASSERT(preemptible >= 0);
             return __put_page_type(l4e_get_page(l4e), preemptible);
+        }
+
+        if ( preemptible < 0 )
+        {
+            current->arch.old_guest_table = l4e_get_page(l4e);
+            return 0;
+        }
+
         return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
     }
     return 1;
@@ -1486,12 +1505,17 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
     if ( rc < 0 && rc != -EAGAIN && rc != -EINTR )
     {
         MEM_LOG("Failure in alloc_l3_table: entry %d", i);
+        if ( i )
+        {
+            page->nr_validated_ptes = i;
+            page->partial_pte = 0;
+            current->arch.old_guest_table = page;
+        }
         while ( i-- > 0 )
         {
             if ( !is_guest_l3_slot(i) )
                 continue;
             unadjust_guest_l3e(pl3e[i], d);
-            put_page_from_l3e(pl3e[i], pfn, 0, 0);
         }
     }
 
@@ -1521,22 +1545,24 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
             page->nr_validated_ptes = i;
             page->partial_pte = partial ?: 1;
         }
-        else if ( rc == -EINTR )
+        else if ( rc < 0 )
         {
+            if ( rc != -EINTR )
+                MEM_LOG("Failure in alloc_l4_table: entry %d", i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
                 page->partial_pte = 0;
-                rc = -EAGAIN;
+                if ( rc == -EINTR )
+                    rc = -EAGAIN;
+                else
+                {
+                    if ( current->arch.old_guest_table )
+                        page->nr_validated_ptes++;
+                    current->arch.old_guest_table = page;
+                }
             }
         }
-        else if ( rc < 0 )
-        {
-            MEM_LOG("Failure in alloc_l4_table: entry %d", i);
-            while ( i-- > 0 )
-                if ( is_guest_l4_slot(d, i) )
-                    put_page_from_l4e(pl4e[i], pfn, 0, 0);
-        }
         if ( rc < 0 )
             return rc;
 
@@ -1966,7 +1992,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, 0);
+    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2029,7 +2055,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, 0);
+    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2187,7 +2213,15 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
                 page_to_mfn(page), get_gpfn_from_mfn(page_to_mfn(page)),
                 type, page->count_info, page->u.inuse.type_info);
-        page->u.inuse.type_info = 0;
+        if ( page != current->arch.old_guest_table )
+            page->u.inuse.type_info = 0;
+        else
+        {
+            ASSERT((page->u.inuse.type_info &
+                    (PGT_count_mask | PGT_validated)) == 1);
+            get_page_light(page);
+            page->u.inuse.type_info |= PGT_partial;
+        }
     }
     else
     {
@@ -3131,21 +3165,17 @@ long do_mmuext_op(
             page = mfn_to_page(mfn);
 
             if ( (rc = xsm_memory_pin_page(d, page)) != 0 )
-            {
-                put_page_and_type(page);
                 okay = 0;
-                break;
-            }
-
-            if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                           &page->u.inuse.type_info)) )
+            else if ( unlikely(test_and_set_bit(_PGT_pinned,
+                                                &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", mfn);
-                put_page_and_type(page);
                 okay = 0;
-                break;
             }
 
+            if ( unlikely(!okay) )
+                goto pin_drop;
+
             /* A page is dirtied when its pin status is set. */
             paging_mark_dirty(pg_owner, mfn);
            
@@ -3159,7 +3189,13 @@ long do_mmuext_op(
                                                &page->u.inuse.type_info));
                 spin_unlock(&pg_owner->page_alloc_lock);
                 if ( drop_ref )
-                    put_page_and_type(page);
+                {
+        pin_drop:
+                    if ( type == PGT_l1_page_table )
+                        put_page_and_type(page);
+                    else
+                        curr->arch.old_guest_table = page;
+                }
             }
 
             break;
@@ -3552,11 +3588,28 @@ long do_mmu_update(
     void *va;
     unsigned long gpfn, gmfn, mfn;
     struct page_info *page;
-    int rc = 0, okay = 1, i = 0;
-    unsigned int cmd, done = 0, pt_dom;
-    struct vcpu *v = current;
+    unsigned int cmd, i = 0, done = 0, pt_dom;
+    struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    int rc = put_old_guest_table(curr), okay = 1;
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmu_update, "hihi", ureqs, count, pdone,
+                     foreigndom);
+        return rc;
+    }
+
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(ureqs)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3605,7 +3658,7 @@ long do_mmu_update(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3870,9 +3923,27 @@ long do_mmu_update(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmu_update, "hihi",
             ureqs, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmu_update, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:45: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 1UY47s-0003nv-MR; Fri, 03 May 2013 00:45:28 +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 1UY47r-0003nc-Be
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:27 +0000
Received: from [193.109.254.147:42221] by server-12.bemta-14.messagelabs.com
	id 65/11-05449-6A803815; Fri, 03 May 2013 00:45:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1367541924!2964132!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24482 invoked from network); 3 May 2013 00:45:25 -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;
	3 May 2013 00:45: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 1UY47o-00021H-3t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47n-0007Xw-Vn
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:24 +0000
Date: Fri, 03 May 2013 00:45:23 +0000
Message-Id: <E1UY47n-0007Xw-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VT-d: don't permit SVT_NO_VERIFY
	entries for known device 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

commit 4c45d2ddc991d5c4e80fc89eb4ad1120702c5ec1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:27:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:27:13 2013 +0200

    VT-d: don't permit SVT_NO_VERIFY entries for known device types
    
    Only in cases where we don't know what to do we should leave the IRTE
    blank (suppressing all validation), but we should always log a warning
    in those cases (as being insecure).
    
    This is CVE-2013-1952 / XSA-49.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master commit: 63cec00679cc65ab5d5a9447a62d5202f155b78c
    master date: 2013-05-02 17:08:58 +0200
---
 xen/drivers/passthrough/vtd/intremap.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 7fc58fe..6dc0584 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -477,16 +477,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
     type = pdev_type(bus, devfn);
     switch ( type )
     {
+    case DEV_TYPE_PCIe_ENDPOINT:
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
-    case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        break;
-
-    case DEV_TYPE_PCIe_ENDPOINT:
         set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus, devfn));
         break;
 
     case DEV_TYPE_PCI:
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    /* case DEV_TYPE_PCI2PCIe_BRIDGE: */
         ret = find_upstream_bridge(&bus, &devfn, &secbus);
         if ( ret == 0 ) /* integrated PCI device */
         {
@@ -498,10 +497,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
             if ( pdev_type(bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
                 set_ire_sid(ire, SVT_VERIFY_BUS, SQ_ALL_16,
                             (bus << 8) | pdev->bus);
-            else if ( pdev_type(bus, devfn) == DEV_TYPE_LEGACY_PCI_BRIDGE )
+            else
                 set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16,
                             PCI_BDF2(bus, devfn));
         }
+        else
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "d%d: no upstream bridge for %02x:%02x.%u\n",
+                    pdev->domain->domain_id,
+                    bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 00:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 00:45: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 1UY47s-0003nv-MR; Fri, 03 May 2013 00:45:28 +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 1UY47r-0003nc-Be
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:27 +0000
Received: from [193.109.254.147:42221] by server-12.bemta-14.messagelabs.com
	id 65/11-05449-6A803815; Fri, 03 May 2013 00:45:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1367541924!2964132!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24482 invoked from network); 3 May 2013 00:45:25 -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;
	3 May 2013 00:45: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 1UY47o-00021H-3t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY47n-0007Xw-Vn
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 00:45:24 +0000
Date: Fri, 03 May 2013 00:45:23 +0000
Message-Id: <E1UY47n-0007Xw-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VT-d: don't permit SVT_NO_VERIFY
	entries for known device 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

commit 4c45d2ddc991d5c4e80fc89eb4ad1120702c5ec1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:27:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:27:13 2013 +0200

    VT-d: don't permit SVT_NO_VERIFY entries for known device types
    
    Only in cases where we don't know what to do we should leave the IRTE
    blank (suppressing all validation), but we should always log a warning
    in those cases (as being insecure).
    
    This is CVE-2013-1952 / XSA-49.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master commit: 63cec00679cc65ab5d5a9447a62d5202f155b78c
    master date: 2013-05-02 17:08:58 +0200
---
 xen/drivers/passthrough/vtd/intremap.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 7fc58fe..6dc0584 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -477,16 +477,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
     type = pdev_type(bus, devfn);
     switch ( type )
     {
+    case DEV_TYPE_PCIe_ENDPOINT:
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
-    case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        break;
-
-    case DEV_TYPE_PCIe_ENDPOINT:
         set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus, devfn));
         break;
 
     case DEV_TYPE_PCI:
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    /* case DEV_TYPE_PCI2PCIe_BRIDGE: */
         ret = find_upstream_bridge(&bus, &devfn, &secbus);
         if ( ret == 0 ) /* integrated PCI device */
         {
@@ -498,10 +497,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
             if ( pdev_type(bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
                 set_ire_sid(ire, SVT_VERIFY_BUS, SQ_ALL_16,
                             (bus << 8) | pdev->bus);
-            else if ( pdev_type(bus, devfn) == DEV_TYPE_LEGACY_PCI_BRIDGE )
+            else
                 set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16,
                             PCI_BDF2(bus, devfn));
         }
+        else
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "d%d: no upstream bridge for %02x:%02x.%u\n",
+                    pdev->domain->domain_id,
+                    bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02: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 1UY5oQ-0001Tq-JU; Fri, 03 May 2013 02:33: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 1UY5oO-0001Tj-NH
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:28 +0000
Received: from [193.109.254.147:58761] by server-11.bemta-14.messagelabs.com
	id A3/8A-24840-8F123815; Fri, 03 May 2013 02:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1367548406!8615821!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4851 invoked from network); 3 May 2013 02:33:27 -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;
	3 May 2013 02:33: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 1UY5oM-0001Z0-7E
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oM-0001c8-1t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:26 +0000
Date: Fri, 03 May 2013 02:33:26 +0000
Message-Id: <E1UY5oM-0001c8-1t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make MMUEXT_NEW_USER_BASEPTR
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f1d1abcc1f5b8c541dd8ef2d970907b2b3515465
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:15:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:15:51 2013 +0200

    x86: make MMUEXT_NEW_USER_BASEPTR preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 918a5f17b447072b40780f4d03a3adc99ff0073b
    master date: 2013-05-02 16:36:44 +0200
---
 xen/arch/x86/mm.c |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d455d13..c120288 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3296,29 +3296,56 @@ long do_mmuext_op(
                 break;
             }
 
+            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
+            /*
+             * This is particularly important when getting restarted after the
+             * previous attempt got preempted in the put-old-MFN phase.
+             */
+            if ( old_mfn == op.arg1.mfn )
+                break;
+
             if ( op.arg1.mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
                     okay = get_page_from_pagenr(op.arg1.mfn, d);
                 else
-                    okay = !get_page_and_type_from_pagenr(
-                        op.arg1.mfn, PGT_root_page_table, d, 0, 0);
+                {
+                    rc = get_page_and_type_from_pagenr(
+                        op.arg1.mfn, PGT_root_page_table, d, 0, 1);
+                    okay = !rc;
+                }
                 if ( unlikely(!okay) )
                 {
-                    MEM_LOG("Error while installing new mfn %lx", op.arg1.mfn);
+                    if ( rc == -EINTR )
+                        rc = -EAGAIN;
+                    else if ( rc != -EAGAIN )
+                        MEM_LOG("Error while installing new mfn %lx",
+                                op.arg1.mfn);
                     break;
                 }
             }
 
-            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
             curr->arch.guest_table_user = pagetable_from_pfn(op.arg1.mfn);
 
             if ( old_mfn != 0 )
             {
+                struct page_info *page = mfn_to_page(old_mfn);
+
                 if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(old_mfn));
+                    put_page(page);
                 else
-                    put_page_and_type(mfn_to_page(old_mfn));
+                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    {
+                    case -EINTR:
+                        rc = -EAGAIN;
+                    case -EAGAIN:
+                        curr->arch.old_guest_table = page;
+                        okay = 0;
+                        break;
+                    default:
+                        BUG_ON(rc);
+                        break;
+                    }
             }
 
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02: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 1UY5oQ-0001Tq-JU; Fri, 03 May 2013 02:33: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 1UY5oO-0001Tj-NH
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:28 +0000
Received: from [193.109.254.147:58761] by server-11.bemta-14.messagelabs.com
	id A3/8A-24840-8F123815; Fri, 03 May 2013 02:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1367548406!8615821!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4851 invoked from network); 3 May 2013 02:33:27 -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;
	3 May 2013 02:33: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 1UY5oM-0001Z0-7E
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oM-0001c8-1t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:26 +0000
Date: Fri, 03 May 2013 02:33:26 +0000
Message-Id: <E1UY5oM-0001c8-1t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make MMUEXT_NEW_USER_BASEPTR
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f1d1abcc1f5b8c541dd8ef2d970907b2b3515465
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:15:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:15:51 2013 +0200

    x86: make MMUEXT_NEW_USER_BASEPTR preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 918a5f17b447072b40780f4d03a3adc99ff0073b
    master date: 2013-05-02 16:36:44 +0200
---
 xen/arch/x86/mm.c |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d455d13..c120288 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3296,29 +3296,56 @@ long do_mmuext_op(
                 break;
             }
 
+            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
+            /*
+             * This is particularly important when getting restarted after the
+             * previous attempt got preempted in the put-old-MFN phase.
+             */
+            if ( old_mfn == op.arg1.mfn )
+                break;
+
             if ( op.arg1.mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
                     okay = get_page_from_pagenr(op.arg1.mfn, d);
                 else
-                    okay = !get_page_and_type_from_pagenr(
-                        op.arg1.mfn, PGT_root_page_table, d, 0, 0);
+                {
+                    rc = get_page_and_type_from_pagenr(
+                        op.arg1.mfn, PGT_root_page_table, d, 0, 1);
+                    okay = !rc;
+                }
                 if ( unlikely(!okay) )
                 {
-                    MEM_LOG("Error while installing new mfn %lx", op.arg1.mfn);
+                    if ( rc == -EINTR )
+                        rc = -EAGAIN;
+                    else if ( rc != -EAGAIN )
+                        MEM_LOG("Error while installing new mfn %lx",
+                                op.arg1.mfn);
                     break;
                 }
             }
 
-            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
             curr->arch.guest_table_user = pagetable_from_pfn(op.arg1.mfn);
 
             if ( old_mfn != 0 )
             {
+                struct page_info *page = mfn_to_page(old_mfn);
+
                 if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(old_mfn));
+                    put_page(page);
                 else
-                    put_page_and_type(mfn_to_page(old_mfn));
+                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    {
+                    case -EINTR:
+                        rc = -EAGAIN;
+                    case -EAGAIN:
+                        curr->arch.old_guest_table = page;
+                        okay = 0;
+                        break;
+                    default:
+                        BUG_ON(rc);
+                        break;
+                    }
             }
 
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02: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 1UY5oN-0001Te-CU; Fri, 03 May 2013 02:33:27 +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 1UY5oM-0001TZ-4t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:26 +0000
Received: from [85.158.139.83:46702] by server-9.bemta-5.messagelabs.com id
	48/04-14875-5F123815; Fri, 03 May 2013 02:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1367548394!28702905!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27979 invoked from network); 3 May 2013 02:33:24 -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;
	3 May 2013 02:33: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 1UY5o0-0001Yu-2D
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5nz-0001bO-0Q
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:03 +0000
Date: Fri, 03 May 2013 02:33:03 +0000
Message-Id: <E1UY5nz-0001bO-0Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make
	vcpu_destroy_pagetables() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f8bdc889ce8e8fe85e6a9f94922d30d765546e72
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:14:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:14:06 2013 +0200

    x86: make vcpu_destroy_pagetables() preemptible
    
    ... as it may take significant amounts of time.
    
    The function, being moved to mm.c as the better home for it anyway, and
    to avoid having to make a new helper function there non-static, is
    given a "preemptible" parameter temporarily (until, in a subsequent
    patch, its other caller is also being made capable of dealing with
    preemption).
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 6cdc9be2a5f2a87b4504404fbf648d16d9503c19
    master date: 2013-05-02 16:34:21 +0200
---
 xen/arch/x86/domain.c           |   67 +++--------------------------
 xen/arch/x86/mm.c               |   89 ++++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |    2 +-
 xen/include/asm-x86/domain.h    |    1 +
 xen/include/asm-x86/mm.h        |    1 +
 5 files changed, 96 insertions(+), 64 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 26a7f12..1c402e7 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -73,8 +73,6 @@ void (*dead_idle) (void) __read_mostly = default_dead_idle;
 static void paravirt_ctxt_switch_from(struct vcpu *v);
 static void paravirt_ctxt_switch_to(struct vcpu *v);
 
-static void vcpu_destroy_pagetables(struct vcpu *v);
-
 static void default_idle(void)
 {
     local_irq_disable();
@@ -1058,7 +1056,7 @@ void arch_vcpu_reset(struct vcpu *v)
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v);
+        vcpu_destroy_pagetables(v, 0);
     }
     else
     {
@@ -2069,63 +2067,6 @@ static int relinquish_memory(
     return ret;
 }
 
-static void vcpu_destroy_pagetables(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long pfn;
-
-#ifdef __x86_64__
-    if ( is_pv_32on64_vcpu(v) )
-    {
-        pfn = l4e_get_pfn(*(l4_pgentry_t *)
-                          __va(pagetable_get_paddr(v->arch.guest_table)));
-
-        if ( pfn != 0 )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-
-        l4e_write(
-            (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
-            l4e_empty());
-
-        v->arch.cr3 = 0;
-        return;
-    }
-#endif
-
-    pfn = pagetable_get_pfn(v->arch.guest_table);
-    if ( pfn != 0 )
-    {
-        if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(pfn));
-        else
-            put_page_and_type(mfn_to_page(pfn));
-        v->arch.guest_table = pagetable_null();
-    }
-
-#ifdef __x86_64__
-    /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
-    pfn = pagetable_get_pfn(v->arch.guest_table_user);
-    if ( pfn != 0 )
-    {
-        if ( !is_pv_32bit_vcpu(v) )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-        v->arch.guest_table_user = pagetable_null();
-    }
-#endif
-
-    v->arch.cr3 = 0;
-}
-
 int domain_relinquish_resources(struct domain *d)
 {
     int ret;
@@ -2143,7 +2084,11 @@ int domain_relinquish_resources(struct domain *d)
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
-            vcpu_destroy_pagetables(v);
+        {
+            ret = vcpu_destroy_pagetables(v, 1);
+            if ( ret )
+                return ret;
+        }
 
         if ( !is_hvm_domain(d) )
         {
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8444610..2f05b60 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2808,6 +2808,82 @@ static void put_superpage(unsigned long mfn)
 
 #endif
 
+static int put_old_guest_table(struct vcpu *v)
+{
+    int rc;
+
+    if ( !v->arch.old_guest_table )
+        return 0;
+
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    {
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    }
+
+    v->arch.old_guest_table = NULL;
+
+    return rc;
+}
+
+int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+{
+    unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
+    struct page_info *page;
+    int rc = put_old_guest_table(v);
+
+    if ( rc )
+        return rc;
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+        mfn = l4e_get_pfn(*(l4_pgentry_t *)mfn_to_virt(mfn));
+#endif
+
+    if ( mfn )
+    {
+        page = mfn_to_page(mfn);
+        if ( paging_mode_refcounts(v->domain) )
+            put_page(page);
+        else
+            rc = put_page_and_type_preemptible(page, preemptible);
+    }
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+    {
+        if ( !rc )
+            l4e_write(
+                (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
+                l4e_empty());
+    }
+    else
+#endif
+    if ( !rc )
+    {
+        v->arch.guest_table = pagetable_null();
+
+#ifdef __x86_64__
+        /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
+        mfn = pagetable_get_pfn(v->arch.guest_table_user);
+        if ( mfn )
+        {
+            page = mfn_to_page(mfn);
+            if ( paging_mode_refcounts(v->domain) )
+                put_page(page);
+            else
+                rc = put_page_and_type_preemptible(page, preemptible);
+        }
+        if ( !rc )
+            v->arch.guest_table_user = pagetable_null();
+#endif
+    }
+
+    v->arch.cr3 = 0;
+
+    return rc;
+}
 
 int new_guest_cr3(unsigned long mfn)
 {
@@ -2994,12 +3070,21 @@ long do_mmuext_op(
     unsigned int foreigndom)
 {
     struct mmuext_op op;
-    int rc = 0, i = 0, okay;
     unsigned long type;
-    unsigned int done = 0;
+    unsigned int i = 0, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
+    int okay, rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmuext_op, "hihi", uops, count, pdone,
+                     foreigndom);
+        return rc;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index fb7baca..ce662a5 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -365,7 +365,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
 
-                BUG_ON(left == arg1);
+                BUG_ON(left == arg1 && left != i);
                 BUG_ON(left > count);
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index aecee68..898f63a 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -464,6 +464,7 @@ struct arch_vcpu
     pagetable_t guest_table_user;       /* (MFN) x86/64 user-space pagetable */
 #endif
     pagetable_t guest_table;            /* (MFN) guest notion of cr3 */
+    struct page_info *old_guest_table;  /* partially destructed pagetable */
     /* guest_table holds a ref to the page, and also a type-count unless
      * shadow refcounts are in use */
     pagetable_t shadow_table[4];        /* (MFN) shadow(s) of guest */
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index ba92568..7e4fc28 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -605,6 +605,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
+int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02: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 1UY5oN-0001Te-CU; Fri, 03 May 2013 02:33:27 +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 1UY5oM-0001TZ-4t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:26 +0000
Received: from [85.158.139.83:46702] by server-9.bemta-5.messagelabs.com id
	48/04-14875-5F123815; Fri, 03 May 2013 02:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1367548394!28702905!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27979 invoked from network); 3 May 2013 02:33:24 -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;
	3 May 2013 02:33: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 1UY5o0-0001Yu-2D
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5nz-0001bO-0Q
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:03 +0000
Date: Fri, 03 May 2013 02:33:03 +0000
Message-Id: <E1UY5nz-0001bO-0Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make
	vcpu_destroy_pagetables() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f8bdc889ce8e8fe85e6a9f94922d30d765546e72
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:14:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:14:06 2013 +0200

    x86: make vcpu_destroy_pagetables() preemptible
    
    ... as it may take significant amounts of time.
    
    The function, being moved to mm.c as the better home for it anyway, and
    to avoid having to make a new helper function there non-static, is
    given a "preemptible" parameter temporarily (until, in a subsequent
    patch, its other caller is also being made capable of dealing with
    preemption).
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 6cdc9be2a5f2a87b4504404fbf648d16d9503c19
    master date: 2013-05-02 16:34:21 +0200
---
 xen/arch/x86/domain.c           |   67 +++--------------------------
 xen/arch/x86/mm.c               |   89 ++++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |    2 +-
 xen/include/asm-x86/domain.h    |    1 +
 xen/include/asm-x86/mm.h        |    1 +
 5 files changed, 96 insertions(+), 64 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 26a7f12..1c402e7 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -73,8 +73,6 @@ void (*dead_idle) (void) __read_mostly = default_dead_idle;
 static void paravirt_ctxt_switch_from(struct vcpu *v);
 static void paravirt_ctxt_switch_to(struct vcpu *v);
 
-static void vcpu_destroy_pagetables(struct vcpu *v);
-
 static void default_idle(void)
 {
     local_irq_disable();
@@ -1058,7 +1056,7 @@ void arch_vcpu_reset(struct vcpu *v)
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v);
+        vcpu_destroy_pagetables(v, 0);
     }
     else
     {
@@ -2069,63 +2067,6 @@ static int relinquish_memory(
     return ret;
 }
 
-static void vcpu_destroy_pagetables(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long pfn;
-
-#ifdef __x86_64__
-    if ( is_pv_32on64_vcpu(v) )
-    {
-        pfn = l4e_get_pfn(*(l4_pgentry_t *)
-                          __va(pagetable_get_paddr(v->arch.guest_table)));
-
-        if ( pfn != 0 )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-
-        l4e_write(
-            (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
-            l4e_empty());
-
-        v->arch.cr3 = 0;
-        return;
-    }
-#endif
-
-    pfn = pagetable_get_pfn(v->arch.guest_table);
-    if ( pfn != 0 )
-    {
-        if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(pfn));
-        else
-            put_page_and_type(mfn_to_page(pfn));
-        v->arch.guest_table = pagetable_null();
-    }
-
-#ifdef __x86_64__
-    /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
-    pfn = pagetable_get_pfn(v->arch.guest_table_user);
-    if ( pfn != 0 )
-    {
-        if ( !is_pv_32bit_vcpu(v) )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-        v->arch.guest_table_user = pagetable_null();
-    }
-#endif
-
-    v->arch.cr3 = 0;
-}
-
 int domain_relinquish_resources(struct domain *d)
 {
     int ret;
@@ -2143,7 +2084,11 @@ int domain_relinquish_resources(struct domain *d)
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
-            vcpu_destroy_pagetables(v);
+        {
+            ret = vcpu_destroy_pagetables(v, 1);
+            if ( ret )
+                return ret;
+        }
 
         if ( !is_hvm_domain(d) )
         {
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8444610..2f05b60 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2808,6 +2808,82 @@ static void put_superpage(unsigned long mfn)
 
 #endif
 
+static int put_old_guest_table(struct vcpu *v)
+{
+    int rc;
+
+    if ( !v->arch.old_guest_table )
+        return 0;
+
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    {
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    }
+
+    v->arch.old_guest_table = NULL;
+
+    return rc;
+}
+
+int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+{
+    unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
+    struct page_info *page;
+    int rc = put_old_guest_table(v);
+
+    if ( rc )
+        return rc;
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+        mfn = l4e_get_pfn(*(l4_pgentry_t *)mfn_to_virt(mfn));
+#endif
+
+    if ( mfn )
+    {
+        page = mfn_to_page(mfn);
+        if ( paging_mode_refcounts(v->domain) )
+            put_page(page);
+        else
+            rc = put_page_and_type_preemptible(page, preemptible);
+    }
+
+#ifdef __x86_64__
+    if ( is_pv_32on64_vcpu(v) )
+    {
+        if ( !rc )
+            l4e_write(
+                (l4_pgentry_t *)__va(pagetable_get_paddr(v->arch.guest_table)),
+                l4e_empty());
+    }
+    else
+#endif
+    if ( !rc )
+    {
+        v->arch.guest_table = pagetable_null();
+
+#ifdef __x86_64__
+        /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
+        mfn = pagetable_get_pfn(v->arch.guest_table_user);
+        if ( mfn )
+        {
+            page = mfn_to_page(mfn);
+            if ( paging_mode_refcounts(v->domain) )
+                put_page(page);
+            else
+                rc = put_page_and_type_preemptible(page, preemptible);
+        }
+        if ( !rc )
+            v->arch.guest_table_user = pagetable_null();
+#endif
+    }
+
+    v->arch.cr3 = 0;
+
+    return rc;
+}
 
 int new_guest_cr3(unsigned long mfn)
 {
@@ -2994,12 +3070,21 @@ long do_mmuext_op(
     unsigned int foreigndom)
 {
     struct mmuext_op op;
-    int rc = 0, i = 0, okay;
     unsigned long type;
-    unsigned int done = 0;
+    unsigned int i = 0, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
+    int okay, rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmuext_op, "hihi", uops, count, pdone,
+                     foreigndom);
+        return rc;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index fb7baca..ce662a5 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -365,7 +365,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
 
-                BUG_ON(left == arg1);
+                BUG_ON(left == arg1 && left != i);
                 BUG_ON(left > count);
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index aecee68..898f63a 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -464,6 +464,7 @@ struct arch_vcpu
     pagetable_t guest_table_user;       /* (MFN) x86/64 user-space pagetable */
 #endif
     pagetable_t guest_table;            /* (MFN) guest notion of cr3 */
+    struct page_info *old_guest_table;  /* partially destructed pagetable */
     /* guest_table holds a ref to the page, and also a type-count unless
      * shadow refcounts are in use */
     pagetable_t shadow_table[4];        /* (MFN) shadow(s) of guest */
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index ba92568..7e4fc28 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -605,6 +605,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
+int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:33: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 1UY5oh-0001VK-MW; Fri, 03 May 2013 02:33:47 +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 1UY5of-0001V7-Kv
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:45 +0000
Received: from [85.158.138.51:49070] by server-12.bemta-3.messagelabs.com id
	48/BD-17342-30223815; Fri, 03 May 2013 02:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1367548416!27940548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22446 invoked from network); 3 May 2013 02:33:37 -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;
	3 May 2013 02:33:37 -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 1UY5oW-0001Z5-GX
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oW-0001cY-Bv
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:36 +0000
Date: Fri, 03 May 2013 02:33:36 +0000
Message-Id: <E1UY5oW-0001cY-Bv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make vcpu_reset() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f26f9b20b15b98a47906ae082bc56fd6832e0a73
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:16:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:16:25 2013 +0200

    x86: make vcpu_reset() preemptible
    
    ... as dropping the old page tables may take significant amounts of
    time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 4939f9a6dee4280f38730fd3066e5dce353112f6
    master date: 2013-05-02 16:37:24 +0200
---
 xen/arch/x86/domain.c     |   13 ++++++-------
 xen/arch/x86/hvm/hvm.c    |    5 ++++-
 xen/arch/x86/hvm/vlapic.c |    5 ++++-
 xen/arch/x86/mm.c         |    6 +++---
 xen/common/domain.c       |   12 ++++++++++--
 xen/common/domctl.c       |    6 ++++--
 xen/include/asm-x86/mm.h  |    2 +-
 xen/include/xen/domain.h  |    4 ++--
 xen/include/xen/sched.h   |    3 +++
 9 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 1c402e7..59f91c1 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1051,17 +1051,16 @@ int arch_set_info_guest(
 #undef c
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v, 0);
-    }
-    else
-    {
-        vcpu_end_shutdown_deferral(v);
+        return vcpu_destroy_pagetables(v);
     }
+
+    vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 /* 
@@ -2085,7 +2084,7 @@ int domain_relinquish_resources(struct domain *d)
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
         {
-            ret = vcpu_destroy_pagetables(v, 1);
+            ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
         }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3d471a5..efacc98 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3509,8 +3509,11 @@ static void hvm_s3_suspend(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
+        int rc;
+
         vlapic_reset(vcpu_vlapic(v));
-        vcpu_reset(v);
+        rc = vcpu_reset(v);
+        ASSERT(!rc);
     }
 
     vpic_reset(d);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 52d111b..7778342 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -252,10 +252,13 @@ static void vlapic_init_sipi_action(unsigned long _vcpu)
     {
     case APIC_DM_INIT: {
         bool_t fpu_initialised;
+        int rc;
+
         domain_lock(target->domain);
         /* Reset necessary VCPU state. This does not include FPU state. */
         fpu_initialised = target->fpu_initialised;
-        vcpu_reset(target);
+        rc = vcpu_reset(target);
+        ASSERT(!rc);
         target->fpu_initialised = fpu_initialised;
         vlapic_reset(vcpu_vlapic(target));
         domain_unlock(target->domain);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index c120288..8ca4fda 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2827,7 +2827,7 @@ static int put_old_guest_table(struct vcpu *v)
     return rc;
 }
 
-int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+int vcpu_destroy_pagetables(struct vcpu *v)
 {
     unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
     struct page_info *page;
@@ -2847,7 +2847,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, preemptible);
+            rc = put_page_and_type_preemptible(page, 1);
     }
 
 #ifdef __x86_64__
@@ -2873,7 +2873,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, preemptible);
+                rc = put_page_and_type_preemptible(page, 1);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
diff --git a/xen/common/domain.c b/xen/common/domain.c
index c09fb73..550916e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -779,14 +779,18 @@ void domain_unpause_by_systemcontroller(struct domain *d)
         domain_unpause(d);
 }
 
-void vcpu_reset(struct vcpu *v)
+int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    int rc;
 
     vcpu_pause(v);
     domain_lock(d);
 
-    arch_vcpu_reset(v);
+    set_bit(_VPF_in_reset, &v->pause_flags);
+    rc = arch_vcpu_reset(v);
+    if ( rc )
+        goto out_unlock;
 
     set_bit(_VPF_down, &v->pause_flags);
 
@@ -802,9 +806,13 @@ void vcpu_reset(struct vcpu *v)
 #endif
     cpumask_clear(v->cpu_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
+ out_unlock:
     domain_unlock(v->domain);
     vcpu_unpause(v);
+
+    return rc;
 }
 
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index cbc8146..ad070c9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -307,8 +307,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 
         if ( guest_handle_is_null(op->u.vcpucontext.ctxt) )
         {
-            vcpu_reset(v);
-            ret = 0;
+            ret = vcpu_reset(v);
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
             goto svc_out;
         }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 7e4fc28..82cdde6 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -605,7 +605,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
-int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
+int vcpu_destroy_pagetables(struct vcpu *);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index d4ac50f..504a70f 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -13,7 +13,7 @@ typedef union {
 struct vcpu *alloc_vcpu(
     struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
 struct vcpu *alloc_dom0_vcpu0(void);
-void vcpu_reset(struct vcpu *v);
+int vcpu_reset(struct vcpu *);
 
 struct xen_domctl_getdomaininfo;
 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
@@ -67,7 +67,7 @@ void arch_dump_vcpu_info(struct vcpu *v);
 
 void arch_dump_domain_info(struct domain *d);
 
-void arch_vcpu_reset(struct vcpu *v);
+int arch_vcpu_reset(struct vcpu *);
 
 extern spinlock_t vcpu_alloc_lock;
 bool_t domctl_lock_acquire(void);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b619269..b0715cb 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -644,6 +644,9 @@ static inline struct domain *next_domain_in_cpupool(
  /* VCPU is blocked due to missing mem_sharing ring. */
 #define _VPF_mem_sharing     6
 #define VPF_mem_sharing      (1UL<<_VPF_mem_sharing)
+ /* VCPU is being reset. */
+#define _VPF_in_reset        7
+#define VPF_in_reset         (1UL<<_VPF_in_reset)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:33: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 1UY5oh-0001VK-MW; Fri, 03 May 2013 02:33:47 +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 1UY5of-0001V7-Kv
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:45 +0000
Received: from [85.158.138.51:49070] by server-12.bemta-3.messagelabs.com id
	48/BD-17342-30223815; Fri, 03 May 2013 02:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1367548416!27940548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22446 invoked from network); 3 May 2013 02:33:37 -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;
	3 May 2013 02:33:37 -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 1UY5oW-0001Z5-GX
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oW-0001cY-Bv
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:36 +0000
Date: Fri, 03 May 2013 02:33:36 +0000
Message-Id: <E1UY5oW-0001cY-Bv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make vcpu_reset() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f26f9b20b15b98a47906ae082bc56fd6832e0a73
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:16:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:16:25 2013 +0200

    x86: make vcpu_reset() preemptible
    
    ... as dropping the old page tables may take significant amounts of
    time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 4939f9a6dee4280f38730fd3066e5dce353112f6
    master date: 2013-05-02 16:37:24 +0200
---
 xen/arch/x86/domain.c     |   13 ++++++-------
 xen/arch/x86/hvm/hvm.c    |    5 ++++-
 xen/arch/x86/hvm/vlapic.c |    5 ++++-
 xen/arch/x86/mm.c         |    6 +++---
 xen/common/domain.c       |   12 ++++++++++--
 xen/common/domctl.c       |    6 ++++--
 xen/include/asm-x86/mm.h  |    2 +-
 xen/include/xen/domain.h  |    4 ++--
 xen/include/xen/sched.h   |    3 +++
 9 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 1c402e7..59f91c1 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1051,17 +1051,16 @@ int arch_set_info_guest(
 #undef c
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v, 0);
-    }
-    else
-    {
-        vcpu_end_shutdown_deferral(v);
+        return vcpu_destroy_pagetables(v);
     }
+
+    vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 /* 
@@ -2085,7 +2084,7 @@ int domain_relinquish_resources(struct domain *d)
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
         {
-            ret = vcpu_destroy_pagetables(v, 1);
+            ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
         }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3d471a5..efacc98 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3509,8 +3509,11 @@ static void hvm_s3_suspend(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
+        int rc;
+
         vlapic_reset(vcpu_vlapic(v));
-        vcpu_reset(v);
+        rc = vcpu_reset(v);
+        ASSERT(!rc);
     }
 
     vpic_reset(d);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 52d111b..7778342 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -252,10 +252,13 @@ static void vlapic_init_sipi_action(unsigned long _vcpu)
     {
     case APIC_DM_INIT: {
         bool_t fpu_initialised;
+        int rc;
+
         domain_lock(target->domain);
         /* Reset necessary VCPU state. This does not include FPU state. */
         fpu_initialised = target->fpu_initialised;
-        vcpu_reset(target);
+        rc = vcpu_reset(target);
+        ASSERT(!rc);
         target->fpu_initialised = fpu_initialised;
         vlapic_reset(vcpu_vlapic(target));
         domain_unlock(target->domain);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index c120288..8ca4fda 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2827,7 +2827,7 @@ static int put_old_guest_table(struct vcpu *v)
     return rc;
 }
 
-int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+int vcpu_destroy_pagetables(struct vcpu *v)
 {
     unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
     struct page_info *page;
@@ -2847,7 +2847,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, preemptible);
+            rc = put_page_and_type_preemptible(page, 1);
     }
 
 #ifdef __x86_64__
@@ -2873,7 +2873,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, preemptible);
+                rc = put_page_and_type_preemptible(page, 1);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
diff --git a/xen/common/domain.c b/xen/common/domain.c
index c09fb73..550916e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -779,14 +779,18 @@ void domain_unpause_by_systemcontroller(struct domain *d)
         domain_unpause(d);
 }
 
-void vcpu_reset(struct vcpu *v)
+int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    int rc;
 
     vcpu_pause(v);
     domain_lock(d);
 
-    arch_vcpu_reset(v);
+    set_bit(_VPF_in_reset, &v->pause_flags);
+    rc = arch_vcpu_reset(v);
+    if ( rc )
+        goto out_unlock;
 
     set_bit(_VPF_down, &v->pause_flags);
 
@@ -802,9 +806,13 @@ void vcpu_reset(struct vcpu *v)
 #endif
     cpumask_clear(v->cpu_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
+ out_unlock:
     domain_unlock(v->domain);
     vcpu_unpause(v);
+
+    return rc;
 }
 
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index cbc8146..ad070c9 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -307,8 +307,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 
         if ( guest_handle_is_null(op->u.vcpucontext.ctxt) )
         {
-            vcpu_reset(v);
-            ret = 0;
+            ret = vcpu_reset(v);
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
             goto svc_out;
         }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 7e4fc28..82cdde6 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -605,7 +605,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
-int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
+int vcpu_destroy_pagetables(struct vcpu *);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index d4ac50f..504a70f 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -13,7 +13,7 @@ typedef union {
 struct vcpu *alloc_vcpu(
     struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
 struct vcpu *alloc_dom0_vcpu0(void);
-void vcpu_reset(struct vcpu *v);
+int vcpu_reset(struct vcpu *);
 
 struct xen_domctl_getdomaininfo;
 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
@@ -67,7 +67,7 @@ void arch_dump_vcpu_info(struct vcpu *v);
 
 void arch_dump_domain_info(struct domain *d);
 
-void arch_vcpu_reset(struct vcpu *v);
+int arch_vcpu_reset(struct vcpu *);
 
 extern spinlock_t vcpu_alloc_lock;
 bool_t domctl_lock_acquire(void);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b619269..b0715cb 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -644,6 +644,9 @@ static inline struct domain *next_domain_in_cpupool(
  /* VCPU is blocked due to missing mem_sharing ring. */
 #define _VPF_mem_sharing     6
 #define VPF_mem_sharing      (1UL<<_VPF_mem_sharing)
+ /* VCPU is being reset. */
+#define _VPF_in_reset        7
+#define VPF_in_reset         (1UL<<_VPF_in_reset)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:33: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 1UY5ol-0001W0-PR; Fri, 03 May 2013 02:33: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 1UY5oj-0001VV-Go
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:49 +0000
Received: from [85.158.139.211:36048] by server-9.bemta-5.messagelabs.com id
	8E/34-14875-C0223815; Fri, 03 May 2013 02:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1367548426!17502264!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12515 invoked from network); 3 May 2013 02:33:47 -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;
	3 May 2013 02:33: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 1UY5og-0001ZE-Nr
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5og-0001cu-Mq
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:46 +0000
Date: Fri, 03 May 2013 02:33:46 +0000
Message-Id: <E1UY5og-0001cu-Mq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make arch_set_info_guest()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dba35fad5518ab3cd6a0972f9ed5629b1df91d69
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:17:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:17:44 2013 +0200

    x86: make arch_set_info_guest() preemptible
    
    .. as the root page table validation (and the dropping of an eventual
    old one) can require meaningful amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 99d2b149915010e986f4d8778708c5891e7b4635
    master date: 2013-05-02 16:38:30 +0200
---
 xen/arch/x86/domain.c      |  115 ++++++++++++++++++++++++--------------------
 xen/common/compat/domain.c |    4 ++
 xen/common/domain.c        |    5 ++
 xen/common/domctl.c        |    4 ++
 4 files changed, 76 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 59f91c1..b97ac6d 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -858,6 +858,9 @@ int arch_set_info_guest(
 
     if ( !v->is_initialised )
     {
+        if ( !compat && !(flags & VGCF_in_kernel) && !c.nat->ctrlreg[1] )
+            return -EINVAL;
+
         v->arch.pv_vcpu.ldt_base = c(ldt_base);
         v->arch.pv_vcpu.ldt_ents = c(ldt_ents);
     }
@@ -955,24 +958,44 @@ int arch_set_info_guest(
     if ( rc != 0 )
         return rc;
 
+    set_bit(_VPF_in_reset, &v->pause_flags);
+
     if ( !compat )
-    {
         cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-        if ( !paging_mode_refcounts(d)
-             && !get_page_type(cr3_page, PGT_base_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
+#ifdef CONFIG_COMPAT
+    else
+        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
+#endif
+    cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
+    if ( !cr3_page )
+        rc = -EINVAL;
+    else if ( paging_mode_refcounts(d) )
+        /* nothing */;
+    else if ( cr3_page == v->arch.old_guest_table )
+    {
+        v->arch.old_guest_table = NULL;
+        put_page(cr3_page);
+    }
+    else
+    {
+        /*
+         * Since v->arch.guest_table{,_user} are both NULL, this effectively
+         * is just a call to put_old_guest_table().
+         */
+        if ( !compat )
+            rc = vcpu_destroy_pagetables(v);
+        if ( !rc )
+            rc = get_page_type_preemptible(cr3_page,
+                                           !compat ? PGT_root_page_table
+                                                   : PGT_l3_page_table);
+        if ( rc == -EINTR )
+            rc = -EAGAIN;
+    }
+    if ( rc )
+        /* handled below */;
+    else if ( !compat )
+    {
         v->arch.guest_table = pagetable_from_page(cr3_page);
 #ifdef __x86_64__
         if ( c.nat->ctrlreg[1] )
@@ -980,56 +1003,44 @@ int arch_set_info_guest(
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
             cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
-            if ( !cr3_page ||
-                 (!paging_mode_refcounts(d)
-                  && !get_page_type(cr3_page, PGT_base_page_table)) )
+            if ( !cr3_page )
+                rc = -EINVAL;
+            else if ( !paging_mode_refcounts(d) )
             {
-                if (cr3_page)
-                    put_page(cr3_page);
-                cr3_page = pagetable_get_page(v->arch.guest_table);
-                v->arch.guest_table = pagetable_null();
-                if ( paging_mode_refcounts(d) )
-                    put_page(cr3_page);
-                else
-                    put_page_and_type(cr3_page);
-                destroy_gdt(v);
-                return -EINVAL;
+                rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
+                switch ( rc )
+                {
+                case -EINTR:
+                    rc = -EAGAIN;
+                case -EAGAIN:
+                    v->arch.old_guest_table =
+                        pagetable_get_page(v->arch.guest_table);
+                    v->arch.guest_table = pagetable_null();
+                    break;
+                }
             }
-
-            v->arch.guest_table_user = pagetable_from_page(cr3_page);
-        }
-        else if ( !(flags & VGCF_in_kernel) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
+            if ( !rc )
+               v->arch.guest_table_user = pagetable_from_page(cr3_page);
         }
     }
     else
     {
         l4_pgentry_t *l4tab;
 
-        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page)
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
-        if (!paging_mode_refcounts(d)
-            && !get_page_type(cr3_page, PGT_l3_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
         l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
         *l4tab = l4e_from_pfn(page_to_mfn(cr3_page),
             _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
 #endif
     }
+    if ( rc )
+    {
+        if ( cr3_page )
+            put_page(cr3_page);
+        destroy_gdt(v);
+        return rc;
+    }
+
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
     if ( v->vcpu_id == 0 )
         update_domain_wallclock_time(d);
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 40a0287..9ddaa38 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -50,6 +50,10 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
         rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, cmp_ctxt);
         domain_unlock(d);
 
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         xfree(cmp_ctxt);
         break;
     }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 550916e..89ab922 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -849,6 +849,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
         domain_unlock(d);
 
         free_vcpu_guest_context(ctxt);
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         break;
 
     case VCPUOP_up: {
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index ad070c9..b3bfb38 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -339,6 +339,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
             domain_pause(d);
             ret = arch_set_info_guest(v, c);
             domain_unpause(d);
+
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
         }
 
     svc_out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:33:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:33: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 1UY5ol-0001W0-PR; Fri, 03 May 2013 02:33: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 1UY5oj-0001VV-Go
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:49 +0000
Received: from [85.158.139.211:36048] by server-9.bemta-5.messagelabs.com id
	8E/34-14875-C0223815; Fri, 03 May 2013 02:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1367548426!17502264!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12515 invoked from network); 3 May 2013 02:33:47 -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;
	3 May 2013 02:33: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 1UY5og-0001ZE-Nr
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5og-0001cu-Mq
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:46 +0000
Date: Fri, 03 May 2013 02:33:46 +0000
Message-Id: <E1UY5og-0001cu-Mq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make arch_set_info_guest()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dba35fad5518ab3cd6a0972f9ed5629b1df91d69
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:17:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:17:44 2013 +0200

    x86: make arch_set_info_guest() preemptible
    
    .. as the root page table validation (and the dropping of an eventual
    old one) can require meaningful amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 99d2b149915010e986f4d8778708c5891e7b4635
    master date: 2013-05-02 16:38:30 +0200
---
 xen/arch/x86/domain.c      |  115 ++++++++++++++++++++++++--------------------
 xen/common/compat/domain.c |    4 ++
 xen/common/domain.c        |    5 ++
 xen/common/domctl.c        |    4 ++
 4 files changed, 76 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 59f91c1..b97ac6d 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -858,6 +858,9 @@ int arch_set_info_guest(
 
     if ( !v->is_initialised )
     {
+        if ( !compat && !(flags & VGCF_in_kernel) && !c.nat->ctrlreg[1] )
+            return -EINVAL;
+
         v->arch.pv_vcpu.ldt_base = c(ldt_base);
         v->arch.pv_vcpu.ldt_ents = c(ldt_ents);
     }
@@ -955,24 +958,44 @@ int arch_set_info_guest(
     if ( rc != 0 )
         return rc;
 
+    set_bit(_VPF_in_reset, &v->pause_flags);
+
     if ( !compat )
-    {
         cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-        if ( !paging_mode_refcounts(d)
-             && !get_page_type(cr3_page, PGT_base_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
+#ifdef CONFIG_COMPAT
+    else
+        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
+#endif
+    cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
+    if ( !cr3_page )
+        rc = -EINVAL;
+    else if ( paging_mode_refcounts(d) )
+        /* nothing */;
+    else if ( cr3_page == v->arch.old_guest_table )
+    {
+        v->arch.old_guest_table = NULL;
+        put_page(cr3_page);
+    }
+    else
+    {
+        /*
+         * Since v->arch.guest_table{,_user} are both NULL, this effectively
+         * is just a call to put_old_guest_table().
+         */
+        if ( !compat )
+            rc = vcpu_destroy_pagetables(v);
+        if ( !rc )
+            rc = get_page_type_preemptible(cr3_page,
+                                           !compat ? PGT_root_page_table
+                                                   : PGT_l3_page_table);
+        if ( rc == -EINTR )
+            rc = -EAGAIN;
+    }
+    if ( rc )
+        /* handled below */;
+    else if ( !compat )
+    {
         v->arch.guest_table = pagetable_from_page(cr3_page);
 #ifdef __x86_64__
         if ( c.nat->ctrlreg[1] )
@@ -980,56 +1003,44 @@ int arch_set_info_guest(
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
             cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
-            if ( !cr3_page ||
-                 (!paging_mode_refcounts(d)
-                  && !get_page_type(cr3_page, PGT_base_page_table)) )
+            if ( !cr3_page )
+                rc = -EINVAL;
+            else if ( !paging_mode_refcounts(d) )
             {
-                if (cr3_page)
-                    put_page(cr3_page);
-                cr3_page = pagetable_get_page(v->arch.guest_table);
-                v->arch.guest_table = pagetable_null();
-                if ( paging_mode_refcounts(d) )
-                    put_page(cr3_page);
-                else
-                    put_page_and_type(cr3_page);
-                destroy_gdt(v);
-                return -EINVAL;
+                rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
+                switch ( rc )
+                {
+                case -EINTR:
+                    rc = -EAGAIN;
+                case -EAGAIN:
+                    v->arch.old_guest_table =
+                        pagetable_get_page(v->arch.guest_table);
+                    v->arch.guest_table = pagetable_null();
+                    break;
+                }
             }
-
-            v->arch.guest_table_user = pagetable_from_page(cr3_page);
-        }
-        else if ( !(flags & VGCF_in_kernel) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
+            if ( !rc )
+               v->arch.guest_table_user = pagetable_from_page(cr3_page);
         }
     }
     else
     {
         l4_pgentry_t *l4tab;
 
-        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page)
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
-        if (!paging_mode_refcounts(d)
-            && !get_page_type(cr3_page, PGT_l3_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
         l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
         *l4tab = l4e_from_pfn(page_to_mfn(cr3_page),
             _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
 #endif
     }
+    if ( rc )
+    {
+        if ( cr3_page )
+            put_page(cr3_page);
+        destroy_gdt(v);
+        return rc;
+    }
+
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
     if ( v->vcpu_id == 0 )
         update_domain_wallclock_time(d);
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 40a0287..9ddaa38 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -50,6 +50,10 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
         rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, cmp_ctxt);
         domain_unlock(d);
 
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         xfree(cmp_ctxt);
         break;
     }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 550916e..89ab922 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -849,6 +849,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
         domain_unlock(d);
 
         free_vcpu_guest_context(ctxt);
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         break;
 
     case VCPUOP_up: {
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index ad070c9..b3bfb38 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -339,6 +339,10 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
             domain_pause(d);
             ret = arch_set_info_guest(v, c);
             domain_unpause(d);
+
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
         }
 
     svc_out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5oy-0001Xa-3P; Fri, 03 May 2013 02:34:04 +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 1UY5ot-0001XF-Ju
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:59 +0000
Received: from [85.158.139.83:48004] by server-15.bemta-5.messagelabs.com id
	04/6D-31797-61223815; Fri, 03 May 2013 02:33:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1367548437!28102636!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12805 invoked from network); 3 May 2013 02:33:58 -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;
	3 May 2013 02:33: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 1UY5oq-0001ZO-Tn
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oq-0001dz-Rr
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:56 +0000
Date: Fri, 03 May 2013 02:33:56 +0000
Message-Id: <E1UY5oq-0001dz-Rr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make page table unpinning
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3e5c1c0093013a4274124eee7862f8e41021b220
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:18:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:18:28 2013 +0200

    x86: make page table unpinning preemptible
    
    ... as it may take significant amounts of time.
    
    Since we can't re-invoke the operation in a second attempt, the
    continuation logic must be slightly tweaked so that we make sure
    do_mmuext_op() gets run one more time even when the preempted unpin
    operation was the last one in a batch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: a3e049f8e86fe18e3b87f18dc0c7be665026fd9f
    master date: 2013-05-02 16:39:06 +0200
---
 xen/arch/x86/mm.c               |   40 +++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |   23 +++++++++++++++++----
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8ca4fda..5d5a15e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3123,6 +3123,14 @@ long do_mmuext_op(
         return rc;
     }
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(uops)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
+
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
         count &= ~MMU_UPDATE_PREEMPTED;
@@ -3146,7 +3154,7 @@ long do_mmuext_op(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3266,7 +3274,17 @@ long do_mmuext_op(
                 break;
             }
 
-            put_page_and_type(page);
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                rc = 0;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
             put_page(page);
 
             /* A page is dirtied when its pin status is cleared. */
@@ -3587,9 +3605,27 @@ long do_mmuext_op(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmuext_op, "hihi",
             uops, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmuext_op, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index ce662a5..ef7822b 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -268,6 +268,13 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
     int rc = 0;
     XEN_GUEST_HANDLE(mmuext_op_t) nat_ops;
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(cmp_uops)) )
+    {
+        set_xen_guest_handle(nat_ops, NULL);
+        return do_mmuext_op(nat_ops, count, pdone, foreigndom);
+    }
+
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
 
@@ -370,12 +377,18 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
                 left = 1;
-                BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops, cmp_uops));
-                BUG_ON(left != arg1);
-                if (!test_bit(_MCSF_in_multicall, &mcs->flags))
-                    regs->_ecx += count - i;
+                if ( arg1 != MMU_UPDATE_PREEMPTED )
+                {
+                    BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops,
+                                                        cmp_uops));
+                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                        regs->_ecx += count - i;
+                    else
+                        mcs->compat_call.args[1] += count - i;
+                }
                 else
-                    mcs->compat_call.args[1] += count - i;
+                    BUG_ON(hypercall_xlat_continuation(&left, 0));
+                BUG_ON(left != arg1);
             }
             else
                 BUG_ON(err > 0);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5oy-0001Xa-3P; Fri, 03 May 2013 02:34:04 +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 1UY5ot-0001XF-Ju
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:59 +0000
Received: from [85.158.139.83:48004] by server-15.bemta-5.messagelabs.com id
	04/6D-31797-61223815; Fri, 03 May 2013 02:33:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1367548437!28102636!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12805 invoked from network); 3 May 2013 02:33:58 -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;
	3 May 2013 02:33: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 1UY5oq-0001ZO-Tn
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oq-0001dz-Rr
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:56 +0000
Date: Fri, 03 May 2013 02:33:56 +0000
Message-Id: <E1UY5oq-0001dz-Rr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make page table unpinning
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3e5c1c0093013a4274124eee7862f8e41021b220
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:18:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:18:28 2013 +0200

    x86: make page table unpinning preemptible
    
    ... as it may take significant amounts of time.
    
    Since we can't re-invoke the operation in a second attempt, the
    continuation logic must be slightly tweaked so that we make sure
    do_mmuext_op() gets run one more time even when the preempted unpin
    operation was the last one in a batch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: a3e049f8e86fe18e3b87f18dc0c7be665026fd9f
    master date: 2013-05-02 16:39:06 +0200
---
 xen/arch/x86/mm.c               |   40 +++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |   23 +++++++++++++++++----
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8ca4fda..5d5a15e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3123,6 +3123,14 @@ long do_mmuext_op(
         return rc;
     }
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(uops)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
+
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
         count &= ~MMU_UPDATE_PREEMPTED;
@@ -3146,7 +3154,7 @@ long do_mmuext_op(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3266,7 +3274,17 @@ long do_mmuext_op(
                 break;
             }
 
-            put_page_and_type(page);
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                rc = 0;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
             put_page(page);
 
             /* A page is dirtied when its pin status is cleared. */
@@ -3587,9 +3605,27 @@ long do_mmuext_op(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmuext_op, "hihi",
             uops, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmuext_op, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index ce662a5..ef7822b 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -268,6 +268,13 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
     int rc = 0;
     XEN_GUEST_HANDLE(mmuext_op_t) nat_ops;
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(cmp_uops)) )
+    {
+        set_xen_guest_handle(nat_ops, NULL);
+        return do_mmuext_op(nat_ops, count, pdone, foreigndom);
+    }
+
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
 
@@ -370,12 +377,18 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mmuext_op_compat_t) cmp_uops,
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
                 left = 1;
-                BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops, cmp_uops));
-                BUG_ON(left != arg1);
-                if (!test_bit(_MCSF_in_multicall, &mcs->flags))
-                    regs->_ecx += count - i;
+                if ( arg1 != MMU_UPDATE_PREEMPTED )
+                {
+                    BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops,
+                                                        cmp_uops));
+                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                        regs->_ecx += count - i;
+                    else
+                        mcs->compat_call.args[1] += count - i;
+                }
                 else
-                    mcs->compat_call.args[1] += count - i;
+                    BUG_ON(hypercall_xlat_continuation(&left, 0));
+                BUG_ON(left != arg1);
             }
             else
                 BUG_ON(err > 0);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5pF-0001as-8T; Fri, 03 May 2013 02:34: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 1UY5pD-0001aW-UI
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:20 +0000
Received: from [85.158.139.83:8693] by server-12.bemta-5.messagelabs.com id
	B4/BB-16465-B2223815; Fri, 03 May 2013 02:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1367548457!31138740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21601 invoked from network); 3 May 2013 02:34:18 -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;
	3 May 2013 02:34: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 1UY5pB-0001a2-A9
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5pB-0001ek-8w
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:17 +0000
Date: Fri, 03 May 2013 02:34:17 +0000
Message-Id: <E1UY5pB-0001ek-8w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: don't permit SVT_NO_VERIFY
	entries for known device 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

commit 5f34d2f90f32c1cf386715a7f9c9bb9c8beb6b1a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:19:41 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:19:41 2013 +0200

    VT-d: don't permit SVT_NO_VERIFY entries for known device types
    
    Only in cases where we don't know what to do we should leave the IRTE
    blank (suppressing all validation), but we should always log a warning
    in those cases (as being insecure).
    
    This is CVE-2013-1952 / XSA-49.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master commit: 63cec00679cc65ab5d5a9447a62d5202f155b78c
    master date: 2013-05-02 17:08:58 +0200
---
 xen/drivers/passthrough/vtd/intremap.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index e7d5158..b6a4f95 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -440,16 +440,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
     type = pdev_type(seg, bus, devfn);
     switch ( type )
     {
+    case DEV_TYPE_PCIe_ENDPOINT:
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
-    case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        break;
-
-    case DEV_TYPE_PCIe_ENDPOINT:
         set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus, devfn));
         break;
 
     case DEV_TYPE_PCI:
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    /* case DEV_TYPE_PCI2PCIe_BRIDGE: */
         ret = find_upstream_bridge(seg, &bus, &devfn, &secbus);
         if ( ret == 0 ) /* integrated PCI device */
         {
@@ -461,10 +460,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
             if ( pdev_type(seg, bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
                 set_ire_sid(ire, SVT_VERIFY_BUS, SQ_ALL_16,
                             (bus << 8) | pdev->bus);
-            else if ( pdev_type(seg, bus, devfn) == DEV_TYPE_LEGACY_PCI_BRIDGE )
+            else
                 set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16,
                             PCI_BDF2(bus, devfn));
         }
+        else
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "d%d: no upstream bridge for %04x:%02x:%02x.%u\n",
+                    pdev->domain->domain_id,
+                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5pF-0001as-8T; Fri, 03 May 2013 02:34: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 1UY5pD-0001aW-UI
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:20 +0000
Received: from [85.158.139.83:8693] by server-12.bemta-5.messagelabs.com id
	B4/BB-16465-B2223815; Fri, 03 May 2013 02:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1367548457!31138740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21601 invoked from network); 3 May 2013 02:34:18 -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;
	3 May 2013 02:34: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 1UY5pB-0001a2-A9
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5pB-0001ek-8w
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:17 +0000
Date: Fri, 03 May 2013 02:34:17 +0000
Message-Id: <E1UY5pB-0001ek-8w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: don't permit SVT_NO_VERIFY
	entries for known device 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

commit 5f34d2f90f32c1cf386715a7f9c9bb9c8beb6b1a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:19:41 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:19:41 2013 +0200

    VT-d: don't permit SVT_NO_VERIFY entries for known device types
    
    Only in cases where we don't know what to do we should leave the IRTE
    blank (suppressing all validation), but we should always log a warning
    in those cases (as being insecure).
    
    This is CVE-2013-1952 / XSA-49.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master commit: 63cec00679cc65ab5d5a9447a62d5202f155b78c
    master date: 2013-05-02 17:08:58 +0200
---
 xen/drivers/passthrough/vtd/intremap.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index e7d5158..b6a4f95 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -440,16 +440,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
     type = pdev_type(seg, bus, devfn);
     switch ( type )
     {
+    case DEV_TYPE_PCIe_ENDPOINT:
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
-    case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        break;
-
-    case DEV_TYPE_PCIe_ENDPOINT:
         set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16, PCI_BDF2(bus, devfn));
         break;
 
     case DEV_TYPE_PCI:
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    /* case DEV_TYPE_PCI2PCIe_BRIDGE: */
         ret = find_upstream_bridge(seg, &bus, &devfn, &secbus);
         if ( ret == 0 ) /* integrated PCI device */
         {
@@ -461,10 +460,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
             if ( pdev_type(seg, bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
                 set_ire_sid(ire, SVT_VERIFY_BUS, SQ_ALL_16,
                             (bus << 8) | pdev->bus);
-            else if ( pdev_type(seg, bus, devfn) == DEV_TYPE_LEGACY_PCI_BRIDGE )
+            else
                 set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16,
                             PCI_BDF2(bus, devfn));
         }
+        else
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "d%d: no upstream bridge for %04x:%02x:%02x.%u\n",
+                    pdev->domain->domain_id,
+                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5pF-0001ay-BF; Fri, 03 May 2013 02:34: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 1UY5pD-0001aV-Tk
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:20 +0000
Received: from [85.158.137.99:18277] by server-12.bemta-3.messagelabs.com id
	1F/FD-17342-B2223815; Fri, 03 May 2013 02:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1367548457!20277795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16511 invoked from network); 3 May 2013 02:34:18 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	3 May 2013 02:34: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 1UY5oB-0001Yx-T3
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oB-0001bm-0W
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:15 +0000
Date: Fri, 03 May 2013 02:33:15 +0000
Message-Id: <E1UY5oB-0001bm-0W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make new_guest_cr3()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a8f694905923e9ad4067d0fb63dbbcfb6e585bff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:15:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:15:13 2013 +0200

    x86: make new_guest_cr3() preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: e2e6b7b627fec0d7a769ab46441f2985ebccbf04
    master date: 2013-05-02 16:35:50 +0200
---
 xen/arch/x86/mm.c    |   82 +++++++++++++++++++++++++++++++++++++------------
 xen/arch/x86/traps.c |   15 ++++++++-
 2 files changed, 75 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2f05b60..d455d13 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2889,44 +2889,69 @@ int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
-    int okay;
+    int rc;
     unsigned long old_base_mfn;
 
 #ifdef __x86_64__
     if ( is_pv_32on64_domain(d) )
     {
-        okay = paging_mode_refcounts(d)
-            ? 0 /* Old code was broken, but what should it be? */
-            : mod_l4_entry(
+        rc = paging_mode_refcounts(d)
+             ? -EINVAL /* Old code was broken, but what should it be? */
+             : mod_l4_entry(
                     __va(pagetable_get_paddr(curr->arch.guest_table)),
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 0, curr) == 0;
-        if ( unlikely(!okay) )
+                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+        switch ( rc )
         {
+        case 0:
+            break;
+        case -EINTR:
+        case -EAGAIN:
+            return -EAGAIN;
+        default:
             MEM_LOG("Error while installing new compat baseptr %lx", mfn);
-            return 0;
+            return rc;
         }
 
         invalidate_shadow_ldt(curr, 0);
         write_ptbase(curr);
 
-        return 1;
+        return 0;
     }
 #endif
-    okay = paging_mode_refcounts(d)
-        ? get_page_from_pagenr(mfn, d)
-        : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
-    if ( unlikely(!okay) )
+    rc = put_old_guest_table(curr);
+    if ( unlikely(rc) )
+        return rc;
+
+    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    /*
+     * This is particularly important when getting restarted after the
+     * previous attempt got preempted in the put-old-MFN phase.
+     */
+    if ( old_base_mfn == mfn )
     {
-        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        write_ptbase(curr);
         return 0;
     }
 
-    invalidate_shadow_ldt(curr, 0);
+    rc = paging_mode_refcounts(d)
+         ? (get_page_from_pagenr(mfn, d) ? 0 : -EINVAL)
+         : get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 1);
+    switch ( rc )
+    {
+    case 0:
+        break;
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    default:
+        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        return rc;
+    }
 
-    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    invalidate_shadow_ldt(curr, 0);
 
     curr->arch.guest_table = pagetable_from_pfn(mfn);
     update_cr3(curr);
@@ -2935,13 +2960,25 @@ int new_guest_cr3(unsigned long mfn)
 
     if ( likely(old_base_mfn != 0) )
     {
+        struct page_info *page = mfn_to_page(old_base_mfn);
+
         if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(old_base_mfn));
+            put_page(page);
         else
-            put_page_and_type(mfn_to_page(old_base_mfn));
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+                rc = -EAGAIN;
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
     }
 
-    return 1;
+    return rc;
 }
 
 static struct domain *get_pg_owner(domid_t domid)
@@ -3239,8 +3276,13 @@ long do_mmuext_op(
         }
 
         case MMUEXT_NEW_BASEPTR:
-            okay = (!paging_mode_translate(d)
-                    && new_guest_cr3(op.arg1.mfn));
+            if ( paging_mode_translate(d) )
+                okay = 0;
+            else
+            {
+                rc = new_guest_cr3(op.arg1.mfn);
+                okay = !rc;
+            }
             break;
 
         
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 692281a..eada470 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2407,12 +2407,23 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
 #endif
             }
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
-            rc = page ? new_guest_cr3(page_to_mfn(page)) : 0;
             if ( page )
+            {
+                rc = new_guest_cr3(page_to_mfn(page));
                 put_page(page);
+            }
+            else
+                rc = -EINVAL;
             domain_unlock(v->domain);
-            if ( rc == 0 ) /* not okay */
+            switch ( rc )
+            {
+            case 0:
+                break;
+            case -EAGAIN: /* retry after preemption */
+                goto skip;
+            default:      /* not okay */
                 goto fail;
+            }
             break;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5pF-0001ay-BF; Fri, 03 May 2013 02:34: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 1UY5pD-0001aV-Tk
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:20 +0000
Received: from [85.158.137.99:18277] by server-12.bemta-3.messagelabs.com id
	1F/FD-17342-B2223815; Fri, 03 May 2013 02:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1367548457!20277795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16511 invoked from network); 3 May 2013 02:34:18 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	3 May 2013 02:34: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 1UY5oB-0001Yx-T3
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5oB-0001bm-0W
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:33:15 +0000
Date: Fri, 03 May 2013 02:33:15 +0000
Message-Id: <E1UY5oB-0001bm-0W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make new_guest_cr3()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a8f694905923e9ad4067d0fb63dbbcfb6e585bff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:15:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:15:13 2013 +0200

    x86: make new_guest_cr3() preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: e2e6b7b627fec0d7a769ab46441f2985ebccbf04
    master date: 2013-05-02 16:35:50 +0200
---
 xen/arch/x86/mm.c    |   82 +++++++++++++++++++++++++++++++++++++------------
 xen/arch/x86/traps.c |   15 ++++++++-
 2 files changed, 75 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2f05b60..d455d13 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2889,44 +2889,69 @@ int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
-    int okay;
+    int rc;
     unsigned long old_base_mfn;
 
 #ifdef __x86_64__
     if ( is_pv_32on64_domain(d) )
     {
-        okay = paging_mode_refcounts(d)
-            ? 0 /* Old code was broken, but what should it be? */
-            : mod_l4_entry(
+        rc = paging_mode_refcounts(d)
+             ? -EINVAL /* Old code was broken, but what should it be? */
+             : mod_l4_entry(
                     __va(pagetable_get_paddr(curr->arch.guest_table)),
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 0, curr) == 0;
-        if ( unlikely(!okay) )
+                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+        switch ( rc )
         {
+        case 0:
+            break;
+        case -EINTR:
+        case -EAGAIN:
+            return -EAGAIN;
+        default:
             MEM_LOG("Error while installing new compat baseptr %lx", mfn);
-            return 0;
+            return rc;
         }
 
         invalidate_shadow_ldt(curr, 0);
         write_ptbase(curr);
 
-        return 1;
+        return 0;
     }
 #endif
-    okay = paging_mode_refcounts(d)
-        ? get_page_from_pagenr(mfn, d)
-        : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
-    if ( unlikely(!okay) )
+    rc = put_old_guest_table(curr);
+    if ( unlikely(rc) )
+        return rc;
+
+    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    /*
+     * This is particularly important when getting restarted after the
+     * previous attempt got preempted in the put-old-MFN phase.
+     */
+    if ( old_base_mfn == mfn )
     {
-        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        write_ptbase(curr);
         return 0;
     }
 
-    invalidate_shadow_ldt(curr, 0);
+    rc = paging_mode_refcounts(d)
+         ? (get_page_from_pagenr(mfn, d) ? 0 : -EINVAL)
+         : get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 1);
+    switch ( rc )
+    {
+    case 0:
+        break;
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    default:
+        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        return rc;
+    }
 
-    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    invalidate_shadow_ldt(curr, 0);
 
     curr->arch.guest_table = pagetable_from_pfn(mfn);
     update_cr3(curr);
@@ -2935,13 +2960,25 @@ int new_guest_cr3(unsigned long mfn)
 
     if ( likely(old_base_mfn != 0) )
     {
+        struct page_info *page = mfn_to_page(old_base_mfn);
+
         if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(old_base_mfn));
+            put_page(page);
         else
-            put_page_and_type(mfn_to_page(old_base_mfn));
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+                rc = -EAGAIN;
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
     }
 
-    return 1;
+    return rc;
 }
 
 static struct domain *get_pg_owner(domid_t domid)
@@ -3239,8 +3276,13 @@ long do_mmuext_op(
         }
 
         case MMUEXT_NEW_BASEPTR:
-            okay = (!paging_mode_translate(d)
-                    && new_guest_cr3(op.arg1.mfn));
+            if ( paging_mode_translate(d) )
+                okay = 0;
+            else
+            {
+                rc = new_guest_cr3(op.arg1.mfn);
+                okay = !rc;
+            }
             break;
 
         
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 692281a..eada470 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2407,12 +2407,23 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
 #endif
             }
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
-            rc = page ? new_guest_cr3(page_to_mfn(page)) : 0;
             if ( page )
+            {
+                rc = new_guest_cr3(page_to_mfn(page));
                 put_page(page);
+            }
+            else
+                rc = -EINVAL;
             domain_unlock(v->domain);
-            if ( rc == 0 ) /* not okay */
+            switch ( rc )
+            {
+            case 0:
+                break;
+            case -EAGAIN: /* retry after preemption */
+                goto skip;
+            default:      /* not okay */
                 goto fail;
+            }
             break;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5pc-0001e8-Ed; Fri, 03 May 2013 02:34:44 +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 1UY5pb-0001dy-CG
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:43 +0000
Received: from [85.158.139.211:27309] by server-14.bemta-5.messagelabs.com id
	B5/60-25870-24223815; Fri, 03 May 2013 02:34:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1367548480!19978544!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6183 invoked from network); 3 May 2013 02:34:41 -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;
	3 May 2013 02:34: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 1UY5p1-0001Zw-4L
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5p1-0001eM-2L
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:07 +0000
Date: Fri, 03 May 2013 02:34:07 +0000
Message-Id: <E1UY5p1-0001eM-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make page table handling
	error paths preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a4b2683b11cce70f9bff74d6cb615e8effa2e32f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:19:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:19:01 2013 +0200

    x86: make page table handling error paths preemptible
    
    ... as they may take significant amounts of time.
    
    This requires cloning the tweaked continuation logic from
    do_mmuext_op() to do_mmu_update().
    
    Note that in mod_l[34]_entry() a negative "preemptible" value gets
    passed to put_page_from_l[34]e() now, telling the callee to store the
    respective page in current->arch.old_guest_table (for a hypercall
    continuation to pick up), rather than carrying out the put right away.
    This is going to be made a little more explicit by a subsequent cleanup
    patch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b8efae696c9a2d46e91fa0eda739427efc16c250
    master date: 2013-05-02 16:39:37 +0200
---
 xen/arch/x86/mm.c |  125 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 98 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 5d5a15e..055f307 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1241,7 +1241,16 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
 #endif
 
     if ( unlikely(partial > 0) )
+    {
+        ASSERT(preemptible >= 0);
         return __put_page_type(l3e_get_page(l3e), preemptible);
+    }
+
+    if ( preemptible < 0 )
+    {
+        current->arch.old_guest_table = l3e_get_page(l3e);
+        return 0;
+    }
 
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
@@ -1254,7 +1263,17 @@ static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
          (l4e_get_pfn(l4e) != pfn) )
     {
         if ( unlikely(partial > 0) )
+        {
+            ASSERT(preemptible >= 0);
             return __put_page_type(l4e_get_page(l4e), preemptible);
+        }
+
+        if ( preemptible < 0 )
+        {
+            current->arch.old_guest_table = l4e_get_page(l4e);
+            return 0;
+        }
+
         return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
     }
     return 1;
@@ -1549,12 +1568,17 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
     if ( rc < 0 && rc != -EAGAIN && rc != -EINTR )
     {
         MEM_LOG("Failure in alloc_l3_table: entry %d", i);
+        if ( i )
+        {
+            page->nr_validated_ptes = i;
+            page->partial_pte = 0;
+            current->arch.old_guest_table = page;
+        }
         while ( i-- > 0 )
         {
             if ( !is_guest_l3_slot(i) )
                 continue;
             unadjust_guest_l3e(pl3e[i], d);
-            put_page_from_l3e(pl3e[i], pfn, 0, 0);
         }
     }
 
@@ -1584,22 +1608,24 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
             page->nr_validated_ptes = i;
             page->partial_pte = partial ?: 1;
         }
-        else if ( rc == -EINTR )
+        else if ( rc < 0 )
         {
+            if ( rc != -EINTR )
+                MEM_LOG("Failure in alloc_l4_table: entry %d", i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
                 page->partial_pte = 0;
-                rc = -EAGAIN;
+                if ( rc == -EINTR )
+                    rc = -EAGAIN;
+                else
+                {
+                    if ( current->arch.old_guest_table )
+                        page->nr_validated_ptes++;
+                    current->arch.old_guest_table = page;
+                }
             }
         }
-        else if ( rc < 0 )
-        {
-            MEM_LOG("Failure in alloc_l4_table: entry %d", i);
-            while ( i-- > 0 )
-                if ( is_guest_l4_slot(d, i) )
-                    put_page_from_l4e(pl4e[i], pfn, 0, 0);
-        }
         if ( rc < 0 )
             return rc;
 
@@ -2047,7 +2073,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, 0);
+    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2110,7 +2136,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, 0);
+    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2268,7 +2294,15 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
                 page_to_mfn(page), get_gpfn_from_mfn(page_to_mfn(page)),
                 type, page->count_info, page->u.inuse.type_info);
-        page->u.inuse.type_info = 0;
+        if ( page != current->arch.old_guest_table )
+            page->u.inuse.type_info = 0;
+        else
+        {
+            ASSERT((page->u.inuse.type_info &
+                    (PGT_count_mask | PGT_validated)) == 1);
+            get_page_light(page);
+            page->u.inuse.type_info |= PGT_partial;
+        }
     }
     else
     {
@@ -3218,21 +3252,17 @@ long do_mmuext_op(
             }
 
             if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
-            {
-                put_page_and_type(page);
                 okay = 0;
-                break;
-            }
-
-            if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                           &page->u.inuse.type_info)) )
+            else if ( unlikely(test_and_set_bit(_PGT_pinned,
+                                                &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", page_to_mfn(page));
-                put_page_and_type(page);
                 okay = 0;
-                break;
             }
 
+            if ( unlikely(!okay) )
+                goto pin_drop;
+
             /* A page is dirtied when its pin status is set. */
             paging_mark_dirty(pg_owner, page_to_mfn(page));
 
@@ -3246,7 +3276,13 @@ long do_mmuext_op(
                                                &page->u.inuse.type_info));
                 spin_unlock(&pg_owner->page_alloc_lock);
                 if ( drop_ref )
-                    put_page_and_type(page);
+                {
+        pin_drop:
+                    if ( type == PGT_l1_page_table )
+                        put_page_and_type(page);
+                    else
+                        curr->arch.old_guest_table = page;
+                }
             }
 
             break;
@@ -3652,11 +3688,28 @@ long do_mmu_update(
     void *va;
     unsigned long gpfn, gmfn, mfn;
     struct page_info *page;
-    int rc = 0, i = 0;
-    unsigned int cmd, done = 0, pt_dom;
-    struct vcpu *v = current;
+    unsigned int cmd, i = 0, done = 0, pt_dom;
+    struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    int rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmu_update, "hihi", ureqs, count, pdone,
+                     foreigndom);
+        return rc;
+    }
+
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(ureqs)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3705,7 +3758,7 @@ long do_mmu_update(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3886,9 +3939,27 @@ long do_mmu_update(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmu_update, "hihi",
             ureqs, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmu_update, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 02:34:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 02:34: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 1UY5pc-0001e8-Ed; Fri, 03 May 2013 02:34:44 +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 1UY5pb-0001dy-CG
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:43 +0000
Received: from [85.158.139.211:27309] by server-14.bemta-5.messagelabs.com id
	B5/60-25870-24223815; Fri, 03 May 2013 02:34:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1367548480!19978544!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6183 invoked from network); 3 May 2013 02:34:41 -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;
	3 May 2013 02:34: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 1UY5p1-0001Zw-4L
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY5p1-0001eM-2L
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 02:34:07 +0000
Date: Fri, 03 May 2013 02:34:07 +0000
Message-Id: <E1UY5p1-0001eM-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: make page table handling
	error paths preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a4b2683b11cce70f9bff74d6cb615e8effa2e32f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:19:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:19:01 2013 +0200

    x86: make page table handling error paths preemptible
    
    ... as they may take significant amounts of time.
    
    This requires cloning the tweaked continuation logic from
    do_mmuext_op() to do_mmu_update().
    
    Note that in mod_l[34]_entry() a negative "preemptible" value gets
    passed to put_page_from_l[34]e() now, telling the callee to store the
    respective page in current->arch.old_guest_table (for a hypercall
    continuation to pick up), rather than carrying out the put right away.
    This is going to be made a little more explicit by a subsequent cleanup
    patch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b8efae696c9a2d46e91fa0eda739427efc16c250
    master date: 2013-05-02 16:39:37 +0200
---
 xen/arch/x86/mm.c |  125 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 98 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 5d5a15e..055f307 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1241,7 +1241,16 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
 #endif
 
     if ( unlikely(partial > 0) )
+    {
+        ASSERT(preemptible >= 0);
         return __put_page_type(l3e_get_page(l3e), preemptible);
+    }
+
+    if ( preemptible < 0 )
+    {
+        current->arch.old_guest_table = l3e_get_page(l3e);
+        return 0;
+    }
 
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
@@ -1254,7 +1263,17 @@ static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
          (l4e_get_pfn(l4e) != pfn) )
     {
         if ( unlikely(partial > 0) )
+        {
+            ASSERT(preemptible >= 0);
             return __put_page_type(l4e_get_page(l4e), preemptible);
+        }
+
+        if ( preemptible < 0 )
+        {
+            current->arch.old_guest_table = l4e_get_page(l4e);
+            return 0;
+        }
+
         return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
     }
     return 1;
@@ -1549,12 +1568,17 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
     if ( rc < 0 && rc != -EAGAIN && rc != -EINTR )
     {
         MEM_LOG("Failure in alloc_l3_table: entry %d", i);
+        if ( i )
+        {
+            page->nr_validated_ptes = i;
+            page->partial_pte = 0;
+            current->arch.old_guest_table = page;
+        }
         while ( i-- > 0 )
         {
             if ( !is_guest_l3_slot(i) )
                 continue;
             unadjust_guest_l3e(pl3e[i], d);
-            put_page_from_l3e(pl3e[i], pfn, 0, 0);
         }
     }
 
@@ -1584,22 +1608,24 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
             page->nr_validated_ptes = i;
             page->partial_pte = partial ?: 1;
         }
-        else if ( rc == -EINTR )
+        else if ( rc < 0 )
         {
+            if ( rc != -EINTR )
+                MEM_LOG("Failure in alloc_l4_table: entry %d", i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
                 page->partial_pte = 0;
-                rc = -EAGAIN;
+                if ( rc == -EINTR )
+                    rc = -EAGAIN;
+                else
+                {
+                    if ( current->arch.old_guest_table )
+                        page->nr_validated_ptes++;
+                    current->arch.old_guest_table = page;
+                }
             }
         }
-        else if ( rc < 0 )
-        {
-            MEM_LOG("Failure in alloc_l4_table: entry %d", i);
-            while ( i-- > 0 )
-                if ( is_guest_l4_slot(d, i) )
-                    put_page_from_l4e(pl4e[i], pfn, 0, 0);
-        }
         if ( rc < 0 )
             return rc;
 
@@ -2047,7 +2073,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, 0);
+    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2110,7 +2136,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, 0);
+    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2268,7 +2294,15 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
                 page_to_mfn(page), get_gpfn_from_mfn(page_to_mfn(page)),
                 type, page->count_info, page->u.inuse.type_info);
-        page->u.inuse.type_info = 0;
+        if ( page != current->arch.old_guest_table )
+            page->u.inuse.type_info = 0;
+        else
+        {
+            ASSERT((page->u.inuse.type_info &
+                    (PGT_count_mask | PGT_validated)) == 1);
+            get_page_light(page);
+            page->u.inuse.type_info |= PGT_partial;
+        }
     }
     else
     {
@@ -3218,21 +3252,17 @@ long do_mmuext_op(
             }
 
             if ( (rc = xsm_memory_pin_page(d, pg_owner, page)) != 0 )
-            {
-                put_page_and_type(page);
                 okay = 0;
-                break;
-            }
-
-            if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                           &page->u.inuse.type_info)) )
+            else if ( unlikely(test_and_set_bit(_PGT_pinned,
+                                                &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", page_to_mfn(page));
-                put_page_and_type(page);
                 okay = 0;
-                break;
             }
 
+            if ( unlikely(!okay) )
+                goto pin_drop;
+
             /* A page is dirtied when its pin status is set. */
             paging_mark_dirty(pg_owner, page_to_mfn(page));
 
@@ -3246,7 +3276,13 @@ long do_mmuext_op(
                                                &page->u.inuse.type_info));
                 spin_unlock(&pg_owner->page_alloc_lock);
                 if ( drop_ref )
-                    put_page_and_type(page);
+                {
+        pin_drop:
+                    if ( type == PGT_l1_page_table )
+                        put_page_and_type(page);
+                    else
+                        curr->arch.old_guest_table = page;
+                }
             }
 
             break;
@@ -3652,11 +3688,28 @@ long do_mmu_update(
     void *va;
     unsigned long gpfn, gmfn, mfn;
     struct page_info *page;
-    int rc = 0, i = 0;
-    unsigned int cmd, done = 0, pt_dom;
-    struct vcpu *v = current;
+    unsigned int cmd, i = 0, done = 0, pt_dom;
+    struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
+    int rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmu_update, "hihi", ureqs, count, pdone,
+                     foreigndom);
+        return rc;
+    }
+
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(ureqs)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3705,7 +3758,7 @@ long do_mmu_update(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3886,9 +3939,27 @@ long do_mmu_update(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmu_update, "hihi",
             ureqs, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmu_update, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04: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 1UY7Va-0003Uf-5I; Fri, 03 May 2013 04:22: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 1UY7VZ-0003Ua-G2
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:09 +0000
Received: from [193.109.254.147:62634] by server-9.bemta-14.messagelabs.com id
	4D/A5-04223-07B33815; Fri, 03 May 2013 04:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1367554926!8602056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10475 invoked from network); 3 May 2013 04:22:06 -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;
	3 May 2013 04:22: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 1UY7VU-0002jk-TF
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7VT-0004Vl-Kf
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:03 +0000
Date: Fri, 03 May 2013 04:22:03 +0000
Message-Id: <E1UY7VT-0004Vl-Kf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make vcpu_destroy_pagetables()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6cdc9be2a5f2a87b4504404fbf648d16d9503c19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:34:21 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:34:21 2013 +0200

    x86: make vcpu_destroy_pagetables() preemptible
    
    ... as it may take significant amounts of time.
    
    The function, being moved to mm.c as the better home for it anyway, and
    to avoid having to make a new helper function there non-static, is
    given a "preemptible" parameter temporarily (until, in a subsequent
    patch, its other caller is also being made capable of dealing with
    preemption).
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain.c           |   60 ++-------------------------
 xen/arch/x86/mm.c               |   86 ++++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |    2 +-
 xen/include/asm-x86/domain.h    |    1 +
 xen/include/asm-x86/mm.h        |    1 +
 5 files changed, 91 insertions(+), 59 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 3e09f58..bc1a31f 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -71,8 +71,6 @@ void (*dead_idle) (void) __read_mostly = default_dead_idle;
 static void paravirt_ctxt_switch_from(struct vcpu *v);
 static void paravirt_ctxt_switch_to(struct vcpu *v);
 
-static void vcpu_destroy_pagetables(struct vcpu *v);
-
 static void default_idle(void)
 {
     local_irq_disable();
@@ -946,7 +944,7 @@ void arch_vcpu_reset(struct vcpu *v)
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v);
+        vcpu_destroy_pagetables(v, 0);
     }
     else
     {
@@ -1944,58 +1942,6 @@ static int relinquish_memory(
     return ret;
 }
 
-static void vcpu_destroy_pagetables(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long pfn = pagetable_get_pfn(v->arch.guest_table);
-
-    if ( is_pv_32on64_vcpu(v) )
-    {
-        l4_pgentry_t *l4tab = map_domain_page(pfn);
-
-        pfn = l4e_get_pfn(*l4tab);
-
-        if ( pfn != 0 )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-
-        l4e_write(l4tab, l4e_empty());
-        unmap_domain_page(l4tab);
-
-        v->arch.cr3 = 0;
-        return;
-    }
-
-    if ( pfn != 0 )
-    {
-        if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(pfn));
-        else
-            put_page_and_type(mfn_to_page(pfn));
-        v->arch.guest_table = pagetable_null();
-    }
-
-    /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
-    pfn = pagetable_get_pfn(v->arch.guest_table_user);
-    if ( pfn != 0 )
-    {
-        if ( !is_pv_32bit_vcpu(v) )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-        v->arch.guest_table_user = pagetable_null();
-    }
-
-    v->arch.cr3 = 0;
-}
-
 int domain_relinquish_resources(struct domain *d)
 {
     int ret;
@@ -2014,7 +1960,9 @@ int domain_relinquish_resources(struct domain *d)
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
         {
-            vcpu_destroy_pagetables(v);
+            ret = vcpu_destroy_pagetables(v, 1);
+            if ( ret )
+                return ret;
 
             unmap_vcpu_info(v);
         }
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0cd4203..9a076e9 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2579,6 +2579,79 @@ static void put_superpage(unsigned long mfn)
     return;
 }
 
+static int put_old_guest_table(struct vcpu *v)
+{
+    int rc;
+
+    if ( !v->arch.old_guest_table )
+        return 0;
+
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    {
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    }
+
+    v->arch.old_guest_table = NULL;
+
+    return rc;
+}
+
+int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+{
+    unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
+    struct page_info *page;
+    l4_pgentry_t *l4tab = NULL;
+    int rc = put_old_guest_table(v);
+
+    if ( rc )
+        return rc;
+
+    if ( is_pv_32on64_vcpu(v) )
+    {
+        l4tab = map_domain_page(mfn);
+        mfn = l4e_get_pfn(*l4tab);
+    }
+
+    if ( mfn )
+    {
+        page = mfn_to_page(mfn);
+        if ( paging_mode_refcounts(v->domain) )
+            put_page(page);
+        else
+            rc = put_page_and_type_preemptible(page, preemptible);
+    }
+
+    if ( l4tab )
+    {
+        if ( !rc )
+            l4e_write(l4tab, l4e_empty());
+        unmap_domain_page(l4tab);
+    }
+    else if ( !rc )
+    {
+        v->arch.guest_table = pagetable_null();
+
+        /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
+        mfn = pagetable_get_pfn(v->arch.guest_table_user);
+        if ( mfn )
+        {
+            page = mfn_to_page(mfn);
+            if ( paging_mode_refcounts(v->domain) )
+                put_page(page);
+            else
+                rc = put_page_and_type_preemptible(page, preemptible);
+        }
+        if ( !rc )
+            v->arch.guest_table_user = pagetable_null();
+    }
+
+    v->arch.cr3 = 0;
+
+    return rc;
+}
+
 int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
@@ -2733,12 +2806,21 @@ long do_mmuext_op(
     unsigned int foreigndom)
 {
     struct mmuext_op op;
-    int rc = 0, i = 0, okay;
     unsigned long type;
-    unsigned int done = 0;
+    unsigned int i = 0, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
+    int okay, rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmuext_op, "hihi", uops, count, pdone,
+                     foreigndom);
+        return rc;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 75e422d..9adc4b4 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -365,7 +365,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
 
-                BUG_ON(left == arg1);
+                BUG_ON(left == arg1 && left != i);
                 BUG_ON(left > count);
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index bdaf714..83fbe58 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -405,6 +405,7 @@ struct arch_vcpu
 
     pagetable_t guest_table_user;       /* (MFN) x86/64 user-space pagetable */
     pagetable_t guest_table;            /* (MFN) guest notion of cr3 */
+    struct page_info *old_guest_table;  /* partially destructed pagetable */
     /* guest_table holds a ref to the page, and also a type-count unless
      * shadow refcounts are in use */
     pagetable_t shadow_table[4];        /* (MFN) shadow(s) of guest */
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 0315257..0f7297a 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -556,6 +556,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
+int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04: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 1UY7Va-0003Uf-5I; Fri, 03 May 2013 04:22: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 1UY7VZ-0003Ua-G2
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:09 +0000
Received: from [193.109.254.147:62634] by server-9.bemta-14.messagelabs.com id
	4D/A5-04223-07B33815; Fri, 03 May 2013 04:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1367554926!8602056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10475 invoked from network); 3 May 2013 04:22:06 -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;
	3 May 2013 04:22: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 1UY7VU-0002jk-TF
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7VT-0004Vl-Kf
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:03 +0000
Date: Fri, 03 May 2013 04:22:03 +0000
Message-Id: <E1UY7VT-0004Vl-Kf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make vcpu_destroy_pagetables()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6cdc9be2a5f2a87b4504404fbf648d16d9503c19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:34:21 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:34:21 2013 +0200

    x86: make vcpu_destroy_pagetables() preemptible
    
    ... as it may take significant amounts of time.
    
    The function, being moved to mm.c as the better home for it anyway, and
    to avoid having to make a new helper function there non-static, is
    given a "preemptible" parameter temporarily (until, in a subsequent
    patch, its other caller is also being made capable of dealing with
    preemption).
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain.c           |   60 ++-------------------------
 xen/arch/x86/mm.c               |   86 ++++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |    2 +-
 xen/include/asm-x86/domain.h    |    1 +
 xen/include/asm-x86/mm.h        |    1 +
 5 files changed, 91 insertions(+), 59 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 3e09f58..bc1a31f 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -71,8 +71,6 @@ void (*dead_idle) (void) __read_mostly = default_dead_idle;
 static void paravirt_ctxt_switch_from(struct vcpu *v);
 static void paravirt_ctxt_switch_to(struct vcpu *v);
 
-static void vcpu_destroy_pagetables(struct vcpu *v);
-
 static void default_idle(void)
 {
     local_irq_disable();
@@ -946,7 +944,7 @@ void arch_vcpu_reset(struct vcpu *v)
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v);
+        vcpu_destroy_pagetables(v, 0);
     }
     else
     {
@@ -1944,58 +1942,6 @@ static int relinquish_memory(
     return ret;
 }
 
-static void vcpu_destroy_pagetables(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long pfn = pagetable_get_pfn(v->arch.guest_table);
-
-    if ( is_pv_32on64_vcpu(v) )
-    {
-        l4_pgentry_t *l4tab = map_domain_page(pfn);
-
-        pfn = l4e_get_pfn(*l4tab);
-
-        if ( pfn != 0 )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-
-        l4e_write(l4tab, l4e_empty());
-        unmap_domain_page(l4tab);
-
-        v->arch.cr3 = 0;
-        return;
-    }
-
-    if ( pfn != 0 )
-    {
-        if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(pfn));
-        else
-            put_page_and_type(mfn_to_page(pfn));
-        v->arch.guest_table = pagetable_null();
-    }
-
-    /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
-    pfn = pagetable_get_pfn(v->arch.guest_table_user);
-    if ( pfn != 0 )
-    {
-        if ( !is_pv_32bit_vcpu(v) )
-        {
-            if ( paging_mode_refcounts(d) )
-                put_page(mfn_to_page(pfn));
-            else
-                put_page_and_type(mfn_to_page(pfn));
-        }
-        v->arch.guest_table_user = pagetable_null();
-    }
-
-    v->arch.cr3 = 0;
-}
-
 int domain_relinquish_resources(struct domain *d)
 {
     int ret;
@@ -2014,7 +1960,9 @@ int domain_relinquish_resources(struct domain *d)
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
         {
-            vcpu_destroy_pagetables(v);
+            ret = vcpu_destroy_pagetables(v, 1);
+            if ( ret )
+                return ret;
 
             unmap_vcpu_info(v);
         }
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0cd4203..9a076e9 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2579,6 +2579,79 @@ static void put_superpage(unsigned long mfn)
     return;
 }
 
+static int put_old_guest_table(struct vcpu *v)
+{
+    int rc;
+
+    if ( !v->arch.old_guest_table )
+        return 0;
+
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    {
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    }
+
+    v->arch.old_guest_table = NULL;
+
+    return rc;
+}
+
+int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+{
+    unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
+    struct page_info *page;
+    l4_pgentry_t *l4tab = NULL;
+    int rc = put_old_guest_table(v);
+
+    if ( rc )
+        return rc;
+
+    if ( is_pv_32on64_vcpu(v) )
+    {
+        l4tab = map_domain_page(mfn);
+        mfn = l4e_get_pfn(*l4tab);
+    }
+
+    if ( mfn )
+    {
+        page = mfn_to_page(mfn);
+        if ( paging_mode_refcounts(v->domain) )
+            put_page(page);
+        else
+            rc = put_page_and_type_preemptible(page, preemptible);
+    }
+
+    if ( l4tab )
+    {
+        if ( !rc )
+            l4e_write(l4tab, l4e_empty());
+        unmap_domain_page(l4tab);
+    }
+    else if ( !rc )
+    {
+        v->arch.guest_table = pagetable_null();
+
+        /* Drop ref to guest_table_user (from MMUEXT_NEW_USER_BASEPTR) */
+        mfn = pagetable_get_pfn(v->arch.guest_table_user);
+        if ( mfn )
+        {
+            page = mfn_to_page(mfn);
+            if ( paging_mode_refcounts(v->domain) )
+                put_page(page);
+            else
+                rc = put_page_and_type_preemptible(page, preemptible);
+        }
+        if ( !rc )
+            v->arch.guest_table_user = pagetable_null();
+    }
+
+    v->arch.cr3 = 0;
+
+    return rc;
+}
+
 int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
@@ -2733,12 +2806,21 @@ long do_mmuext_op(
     unsigned int foreigndom)
 {
     struct mmuext_op op;
-    int rc = 0, i = 0, okay;
     unsigned long type;
-    unsigned int done = 0;
+    unsigned int i = 0, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
+    int okay, rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmuext_op, "hihi", uops, count, pdone,
+                     foreigndom);
+        return rc;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 75e422d..9adc4b4 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -365,7 +365,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
 
-                BUG_ON(left == arg1);
+                BUG_ON(left == arg1 && left != i);
                 BUG_ON(left > count);
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index bdaf714..83fbe58 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -405,6 +405,7 @@ struct arch_vcpu
 
     pagetable_t guest_table_user;       /* (MFN) x86/64 user-space pagetable */
     pagetable_t guest_table;            /* (MFN) guest notion of cr3 */
+    struct page_info *old_guest_table;  /* partially destructed pagetable */
     /* guest_table holds a ref to the page, and also a type-count unless
      * shadow refcounts are in use */
     pagetable_t shadow_table[4];        /* (MFN) shadow(s) of guest */
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 0315257..0f7297a 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -556,6 +556,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
+int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22: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 1UY7Vl-0003VG-8e; Fri, 03 May 2013 04:22: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 1UY7Vk-0003Ux-4Y
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:20 +0000
Received: from [193.109.254.147:62799] by server-13.bemta-14.messagelabs.com
	id D6/F2-07387-B7B33815; Fri, 03 May 2013 04:22:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1367554936!8662654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23942 invoked from network); 3 May 2013 04:22:17 -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;
	3 May 2013 04:22: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 1UY7Vg-0002jv-55
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Vf-0004WA-31
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:15 +0000
Date: Fri, 03 May 2013 04:22:15 +0000
Message-Id: <E1UY7Vf-0004WA-31@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make new_guest_cr3() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 e2e6b7b627fec0d7a769ab46441f2985ebccbf04
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:35:50 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:35:50 2013 +0200

    x86: make new_guest_cr3() preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c    |   82 +++++++++++++++++++++++++++++++++++++------------
 xen/arch/x86/traps.c |   15 ++++++++-
 2 files changed, 75 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9a076e9..e43a698 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2656,7 +2656,7 @@ int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
-    int okay;
+    int rc;
     unsigned long old_base_mfn;
 
     if ( is_pv_32on64_domain(d) )
@@ -2664,39 +2664,64 @@ int new_guest_cr3(unsigned long mfn)
         unsigned long gt_mfn = pagetable_get_pfn(curr->arch.guest_table);
         l4_pgentry_t *pl4e = map_domain_page(gt_mfn);
 
-        okay = paging_mode_refcounts(d)
-            ? 0 /* Old code was broken, but what should it be? */
-            : mod_l4_entry(
+        rc = paging_mode_refcounts(d)
+             ? -EINVAL /* Old code was broken, but what should it be? */
+             : mod_l4_entry(
                     pl4e,
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    gt_mfn, 0, 0, curr) == 0;
+                    gt_mfn, 0, 1, curr);
         unmap_domain_page(pl4e);
-        if ( unlikely(!okay) )
+        switch ( rc )
         {
+        case 0:
+            break;
+        case -EINTR:
+        case -EAGAIN:
+            return -EAGAIN;
+        default:
             MEM_LOG("Error while installing new compat baseptr %lx", mfn);
-            return 0;
+            return rc;
         }
 
         invalidate_shadow_ldt(curr, 0);
         write_ptbase(curr);
 
-        return 1;
+        return 0;
     }
 
-    okay = paging_mode_refcounts(d)
-        ? get_page_from_pagenr(mfn, d)
-        : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
-    if ( unlikely(!okay) )
+    rc = put_old_guest_table(curr);
+    if ( unlikely(rc) )
+        return rc;
+
+    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    /*
+     * This is particularly important when getting restarted after the
+     * previous attempt got preempted in the put-old-MFN phase.
+     */
+    if ( old_base_mfn == mfn )
     {
-        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        write_ptbase(curr);
         return 0;
     }
 
-    invalidate_shadow_ldt(curr, 0);
+    rc = paging_mode_refcounts(d)
+         ? (get_page_from_pagenr(mfn, d) ? 0 : -EINVAL)
+         : get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 1);
+    switch ( rc )
+    {
+    case 0:
+        break;
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    default:
+        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        return rc;
+    }
 
-    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    invalidate_shadow_ldt(curr, 0);
 
     curr->arch.guest_table = pagetable_from_pfn(mfn);
     update_cr3(curr);
@@ -2705,13 +2730,25 @@ int new_guest_cr3(unsigned long mfn)
 
     if ( likely(old_base_mfn != 0) )
     {
+        struct page_info *page = mfn_to_page(old_base_mfn);
+
         if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(old_base_mfn));
+            put_page(page);
         else
-            put_page_and_type(mfn_to_page(old_base_mfn));
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+                rc = -EAGAIN;
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
     }
 
-    return 1;
+    return rc;
 }
 
 static struct domain *get_pg_owner(domid_t domid)
@@ -2982,8 +3019,13 @@ long do_mmuext_op(
         }
 
         case MMUEXT_NEW_BASEPTR:
-            okay = (!paging_mode_translate(d)
-                    && new_guest_cr3(op.arg1.mfn));
+            if ( paging_mode_translate(d) )
+                okay = 0;
+            else
+            {
+                rc = new_guest_cr3(op.arg1.mfn);
+                okay = !rc;
+            }
             break;
 
         case MMUEXT_NEW_USER_BASEPTR: {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index d36eddd..4de9313 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2322,12 +2322,23 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             gfn = !is_pv_32on64_vcpu(v)
                 ? xen_cr3_to_pfn(*reg) : compat_cr3_to_pfn(*reg);
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
-            rc = page ? new_guest_cr3(page_to_mfn(page)) : 0;
             if ( page )
+            {
+                rc = new_guest_cr3(page_to_mfn(page));
                 put_page(page);
+            }
+            else
+                rc = -EINVAL;
             domain_unlock(v->domain);
-            if ( rc == 0 ) /* not okay */
+            switch ( rc )
+            {
+            case 0:
+                break;
+            case -EAGAIN: /* retry after preemption */
+                goto skip;
+            default:      /* not okay */
                 goto fail;
+            }
             break;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22: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 1UY7Vl-0003VG-8e; Fri, 03 May 2013 04:22: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 1UY7Vk-0003Ux-4Y
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:20 +0000
Received: from [193.109.254.147:62799] by server-13.bemta-14.messagelabs.com
	id D6/F2-07387-B7B33815; Fri, 03 May 2013 04:22:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1367554936!8662654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23942 invoked from network); 3 May 2013 04:22:17 -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;
	3 May 2013 04:22: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 1UY7Vg-0002jv-55
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Vf-0004WA-31
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:15 +0000
Date: Fri, 03 May 2013 04:22:15 +0000
Message-Id: <E1UY7Vf-0004WA-31@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make new_guest_cr3() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 e2e6b7b627fec0d7a769ab46441f2985ebccbf04
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:35:50 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:35:50 2013 +0200

    x86: make new_guest_cr3() preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c    |   82 +++++++++++++++++++++++++++++++++++++------------
 xen/arch/x86/traps.c |   15 ++++++++-
 2 files changed, 75 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9a076e9..e43a698 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2656,7 +2656,7 @@ int new_guest_cr3(unsigned long mfn)
 {
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
-    int okay;
+    int rc;
     unsigned long old_base_mfn;
 
     if ( is_pv_32on64_domain(d) )
@@ -2664,39 +2664,64 @@ int new_guest_cr3(unsigned long mfn)
         unsigned long gt_mfn = pagetable_get_pfn(curr->arch.guest_table);
         l4_pgentry_t *pl4e = map_domain_page(gt_mfn);
 
-        okay = paging_mode_refcounts(d)
-            ? 0 /* Old code was broken, but what should it be? */
-            : mod_l4_entry(
+        rc = paging_mode_refcounts(d)
+             ? -EINVAL /* Old code was broken, but what should it be? */
+             : mod_l4_entry(
                     pl4e,
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    gt_mfn, 0, 0, curr) == 0;
+                    gt_mfn, 0, 1, curr);
         unmap_domain_page(pl4e);
-        if ( unlikely(!okay) )
+        switch ( rc )
         {
+        case 0:
+            break;
+        case -EINTR:
+        case -EAGAIN:
+            return -EAGAIN;
+        default:
             MEM_LOG("Error while installing new compat baseptr %lx", mfn);
-            return 0;
+            return rc;
         }
 
         invalidate_shadow_ldt(curr, 0);
         write_ptbase(curr);
 
-        return 1;
+        return 0;
     }
 
-    okay = paging_mode_refcounts(d)
-        ? get_page_from_pagenr(mfn, d)
-        : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
-    if ( unlikely(!okay) )
+    rc = put_old_guest_table(curr);
+    if ( unlikely(rc) )
+        return rc;
+
+    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    /*
+     * This is particularly important when getting restarted after the
+     * previous attempt got preempted in the put-old-MFN phase.
+     */
+    if ( old_base_mfn == mfn )
     {
-        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        write_ptbase(curr);
         return 0;
     }
 
-    invalidate_shadow_ldt(curr, 0);
+    rc = paging_mode_refcounts(d)
+         ? (get_page_from_pagenr(mfn, d) ? 0 : -EINVAL)
+         : get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 1);
+    switch ( rc )
+    {
+    case 0:
+        break;
+    case -EINTR:
+    case -EAGAIN:
+        return -EAGAIN;
+    default:
+        MEM_LOG("Error while installing new baseptr %lx", mfn);
+        return rc;
+    }
 
-    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
+    invalidate_shadow_ldt(curr, 0);
 
     curr->arch.guest_table = pagetable_from_pfn(mfn);
     update_cr3(curr);
@@ -2705,13 +2730,25 @@ int new_guest_cr3(unsigned long mfn)
 
     if ( likely(old_base_mfn != 0) )
     {
+        struct page_info *page = mfn_to_page(old_base_mfn);
+
         if ( paging_mode_refcounts(d) )
-            put_page(mfn_to_page(old_base_mfn));
+            put_page(page);
         else
-            put_page_and_type(mfn_to_page(old_base_mfn));
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+                rc = -EAGAIN;
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
     }
 
-    return 1;
+    return rc;
 }
 
 static struct domain *get_pg_owner(domid_t domid)
@@ -2982,8 +3019,13 @@ long do_mmuext_op(
         }
 
         case MMUEXT_NEW_BASEPTR:
-            okay = (!paging_mode_translate(d)
-                    && new_guest_cr3(op.arg1.mfn));
+            if ( paging_mode_translate(d) )
+                okay = 0;
+            else
+            {
+                rc = new_guest_cr3(op.arg1.mfn);
+                okay = !rc;
+            }
             break;
 
         case MMUEXT_NEW_USER_BASEPTR: {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index d36eddd..4de9313 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2322,12 +2322,23 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             gfn = !is_pv_32on64_vcpu(v)
                 ? xen_cr3_to_pfn(*reg) : compat_cr3_to_pfn(*reg);
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
-            rc = page ? new_guest_cr3(page_to_mfn(page)) : 0;
             if ( page )
+            {
+                rc = new_guest_cr3(page_to_mfn(page));
                 put_page(page);
+            }
+            else
+                rc = -EINVAL;
             domain_unlock(v->domain);
-            if ( rc == 0 ) /* not okay */
+            switch ( rc )
+            {
+            case 0:
+                break;
+            case -EAGAIN: /* retry after preemption */
+                goto skip;
+            default:      /* not okay */
                 goto fail;
+            }
             break;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UY7Vv-0003W7-Bh; Fri, 03 May 2013 04:22: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 1UY7Vu-0003Vx-2Z
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:30 +0000
Received: from [85.158.137.99:9063] by server-11.bemta-3.messagelabs.com id
	95/CC-05438-48B33815; Fri, 03 May 2013 04:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1367554946!17070480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8991 invoked from network); 3 May 2013 04:22:27 -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;
	3 May 2013 04:22: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 1UY7Vq-0002k4-Bo
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Vq-0004WW-9E
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:26 +0000
Date: Fri, 03 May 2013 04:22:26 +0000
Message-Id: <E1UY7Vq-0004WW-9E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make MMUEXT_NEW_USER_BASEPTR
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 918a5f17b447072b40780f4d03a3adc99ff0073b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:36:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:36:44 2013 +0200

    x86: make MMUEXT_NEW_USER_BASEPTR preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e43a698..bada0bd 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3037,29 +3037,56 @@ long do_mmuext_op(
                 break;
             }
 
+            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
+            /*
+             * This is particularly important when getting restarted after the
+             * previous attempt got preempted in the put-old-MFN phase.
+             */
+            if ( old_mfn == op.arg1.mfn )
+                break;
+
             if ( op.arg1.mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
                     okay = get_page_from_pagenr(op.arg1.mfn, d);
                 else
-                    okay = !get_page_and_type_from_pagenr(
-                        op.arg1.mfn, PGT_root_page_table, d, 0, 0);
+                {
+                    rc = get_page_and_type_from_pagenr(
+                        op.arg1.mfn, PGT_root_page_table, d, 0, 1);
+                    okay = !rc;
+                }
                 if ( unlikely(!okay) )
                 {
-                    MEM_LOG("Error while installing new mfn %lx", op.arg1.mfn);
+                    if ( rc == -EINTR )
+                        rc = -EAGAIN;
+                    else if ( rc != -EAGAIN )
+                        MEM_LOG("Error while installing new mfn %lx",
+                                op.arg1.mfn);
                     break;
                 }
             }
 
-            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
             curr->arch.guest_table_user = pagetable_from_pfn(op.arg1.mfn);
 
             if ( old_mfn != 0 )
             {
+                struct page_info *page = mfn_to_page(old_mfn);
+
                 if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(old_mfn));
+                    put_page(page);
                 else
-                    put_page_and_type(mfn_to_page(old_mfn));
+                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    {
+                    case -EINTR:
+                        rc = -EAGAIN;
+                    case -EAGAIN:
+                        curr->arch.old_guest_table = page;
+                        okay = 0;
+                        break;
+                    default:
+                        BUG_ON(rc);
+                        break;
+                    }
             }
 
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UY7Vv-0003W7-Bh; Fri, 03 May 2013 04:22: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 1UY7Vu-0003Vx-2Z
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:30 +0000
Received: from [85.158.137.99:9063] by server-11.bemta-3.messagelabs.com id
	95/CC-05438-48B33815; Fri, 03 May 2013 04:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1367554946!17070480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8991 invoked from network); 3 May 2013 04:22:27 -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;
	3 May 2013 04:22: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 1UY7Vq-0002k4-Bo
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Vq-0004WW-9E
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:26 +0000
Date: Fri, 03 May 2013 04:22:26 +0000
Message-Id: <E1UY7Vq-0004WW-9E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make MMUEXT_NEW_USER_BASEPTR
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 918a5f17b447072b40780f4d03a3adc99ff0073b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:36:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:36:44 2013 +0200

    x86: make MMUEXT_NEW_USER_BASEPTR preemptible
    
    ... as it may take significant amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e43a698..bada0bd 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3037,29 +3037,56 @@ long do_mmuext_op(
                 break;
             }
 
+            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
+            /*
+             * This is particularly important when getting restarted after the
+             * previous attempt got preempted in the put-old-MFN phase.
+             */
+            if ( old_mfn == op.arg1.mfn )
+                break;
+
             if ( op.arg1.mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
                     okay = get_page_from_pagenr(op.arg1.mfn, d);
                 else
-                    okay = !get_page_and_type_from_pagenr(
-                        op.arg1.mfn, PGT_root_page_table, d, 0, 0);
+                {
+                    rc = get_page_and_type_from_pagenr(
+                        op.arg1.mfn, PGT_root_page_table, d, 0, 1);
+                    okay = !rc;
+                }
                 if ( unlikely(!okay) )
                 {
-                    MEM_LOG("Error while installing new mfn %lx", op.arg1.mfn);
+                    if ( rc == -EINTR )
+                        rc = -EAGAIN;
+                    else if ( rc != -EAGAIN )
+                        MEM_LOG("Error while installing new mfn %lx",
+                                op.arg1.mfn);
                     break;
                 }
             }
 
-            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
             curr->arch.guest_table_user = pagetable_from_pfn(op.arg1.mfn);
 
             if ( old_mfn != 0 )
             {
+                struct page_info *page = mfn_to_page(old_mfn);
+
                 if ( paging_mode_refcounts(d) )
-                    put_page(mfn_to_page(old_mfn));
+                    put_page(page);
                 else
-                    put_page_and_type(mfn_to_page(old_mfn));
+                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    {
+                    case -EINTR:
+                        rc = -EAGAIN;
+                    case -EAGAIN:
+                        curr->arch.old_guest_table = page;
+                        okay = 0;
+                        break;
+                    default:
+                        BUG_ON(rc);
+                        break;
+                    }
             }
 
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22: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 1UY7W5-0003XJ-F1; Fri, 03 May 2013 04:22:41 +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 1UY7W3-0003X1-Kl
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:39 +0000
Received: from [193.109.254.147:23176] by server-4.bemta-14.messagelabs.com id
	5A/2B-17387-E8B33815; Fri, 03 May 2013 04:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1367554956!8662676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24217 invoked from network); 3 May 2013 04:22:37 -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;
	3 May 2013 04:22:37 -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 1UY7W0-0002kC-IC
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7W0-0004Wt-GK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:36 +0000
Date: Fri, 03 May 2013 04:22:36 +0000
Message-Id: <E1UY7W0-0004Wt-GK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make vcpu_reset() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4939f9a6dee4280f38730fd3066e5dce353112f6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:37:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:37:24 2013 +0200

    x86: make vcpu_reset() preemptible
    
    ... as dropping the old page tables may take significant amounts of
    time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/domain.c     |    3 ++-
 xen/arch/x86/domain.c     |   13 ++++++-------
 xen/arch/x86/hvm/hvm.c    |    5 ++++-
 xen/arch/x86/hvm/vlapic.c |    5 ++++-
 xen/arch/x86/mm.c         |    6 +++---
 xen/common/domain.c       |   12 ++++++++++--
 xen/common/domctl.c       |   13 +++++++------
 xen/include/asm-x86/mm.h  |    2 +-
 xen/include/xen/domain.h  |    4 ++--
 xen/include/xen/sched.h   |    3 +++
 10 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2af40a1..141aa0b 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -566,9 +566,10 @@ int arch_set_info_guest(
     return 0;
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 static int relinquish_memory(struct domain *d, struct page_list_head *list)
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index bc1a31f..5bf52ff 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -939,17 +939,16 @@ int arch_set_info_guest(
 #undef c
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v, 0);
-    }
-    else
-    {
-        vcpu_end_shutdown_deferral(v);
+        return vcpu_destroy_pagetables(v);
     }
+
+    vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 /* 
@@ -1960,7 +1959,7 @@ int domain_relinquish_resources(struct domain *d)
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
         {
-            ret = vcpu_destroy_pagetables(v, 1);
+            ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c8487b8..7c3cb15 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3555,8 +3555,11 @@ static void hvm_s3_suspend(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
+        int rc;
+
         vlapic_reset(vcpu_vlapic(v));
-        vcpu_reset(v);
+        rc = vcpu_reset(v);
+        ASSERT(!rc);
     }
 
     vpic_reset(d);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 9e1db88..8c6a7e2 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -240,6 +240,8 @@ static void vlapic_init_sipi_one(struct vcpu *target, uint32_t icr)
     {
     case APIC_DM_INIT: {
         bool_t fpu_initialised;
+        int rc;
+
         /* No work on INIT de-assert for P4-type APIC. */
         if ( (icr & (APIC_INT_LEVELTRIG | APIC_INT_ASSERT)) ==
              APIC_INT_LEVELTRIG )
@@ -251,7 +253,8 @@ static void vlapic_init_sipi_one(struct vcpu *target, uint32_t icr)
         domain_lock(target->domain);
         /* Reset necessary VCPU state. This does not include FPU state. */
         fpu_initialised = target->fpu_initialised;
-        vcpu_reset(target);
+        rc = vcpu_reset(target);
+        ASSERT(!rc);
         target->fpu_initialised = fpu_initialised;
         vlapic_reset(vcpu_vlapic(target));
         domain_unlock(target->domain);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index bada0bd..10e9217 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2598,7 +2598,7 @@ static int put_old_guest_table(struct vcpu *v)
     return rc;
 }
 
-int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+int vcpu_destroy_pagetables(struct vcpu *v)
 {
     unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
     struct page_info *page;
@@ -2620,7 +2620,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, preemptible);
+            rc = put_page_and_type_preemptible(page, 1);
     }
 
     if ( l4tab )
@@ -2641,7 +2641,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, preemptible);
+                rc = put_page_and_type_preemptible(page, 1);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
diff --git a/xen/common/domain.c b/xen/common/domain.c
index ce45d66..7cca655 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -868,14 +868,18 @@ void domain_unpause_by_systemcontroller(struct domain *d)
         domain_unpause(d);
 }
 
-void vcpu_reset(struct vcpu *v)
+int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    int rc;
 
     vcpu_pause(v);
     domain_lock(d);
 
-    arch_vcpu_reset(v);
+    set_bit(_VPF_in_reset, &v->pause_flags);
+    rc = arch_vcpu_reset(v);
+    if ( rc )
+        goto out_unlock;
 
     set_bit(_VPF_down, &v->pause_flags);
 
@@ -891,9 +895,13 @@ void vcpu_reset(struct vcpu *v)
 #endif
     cpumask_clear(v->cpu_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
+ out_unlock:
     domain_unlock(v->domain);
     vcpu_unpause(v);
+
+    return rc;
 }
 
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 73b12c8..1d00cfc 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -332,13 +332,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
-            goto svc_out;
+            break;
 
         if ( guest_handle_is_null(op->u.vcpucontext.ctxt) )
         {
-            vcpu_reset(v);
-            ret = 0;
-            goto svc_out;
+            ret = vcpu_reset(v);
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
+            break;
         }
 
 #ifdef CONFIG_COMPAT
@@ -347,7 +349,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 #endif
         ret = -ENOMEM;
         if ( (c.nat = alloc_vcpu_guest_context()) == NULL )
-            goto svc_out;
+            break;
 
 #ifdef CONFIG_COMPAT
         if ( !is_pv_32on64_vcpu(v) )
@@ -368,7 +370,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             domain_unpause(d);
         }
 
-    svc_out:
         free_vcpu_guest_context(c.nat);
     }
     break;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 0f7297a..79c526f 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -556,7 +556,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
-int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
+int vcpu_destroy_pagetables(struct vcpu *);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index d4ac50f..504a70f 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -13,7 +13,7 @@ typedef union {
 struct vcpu *alloc_vcpu(
     struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
 struct vcpu *alloc_dom0_vcpu0(void);
-void vcpu_reset(struct vcpu *v);
+int vcpu_reset(struct vcpu *);
 
 struct xen_domctl_getdomaininfo;
 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
@@ -67,7 +67,7 @@ void arch_dump_vcpu_info(struct vcpu *v);
 
 void arch_dump_domain_info(struct domain *d);
 
-void arch_vcpu_reset(struct vcpu *v);
+int arch_vcpu_reset(struct vcpu *);
 
 extern spinlock_t vcpu_alloc_lock;
 bool_t domctl_lock_acquire(void);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index beadc42..41f749e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -682,6 +682,9 @@ static inline struct domain *next_domain_in_cpupool(
  /* VCPU is blocked due to missing mem_sharing ring. */
 #define _VPF_mem_sharing     6
 #define VPF_mem_sharing      (1UL<<_VPF_mem_sharing)
+ /* VCPU is being reset. */
+#define _VPF_in_reset        7
+#define VPF_in_reset         (1UL<<_VPF_in_reset)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22: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 1UY7W5-0003XJ-F1; Fri, 03 May 2013 04:22:41 +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 1UY7W3-0003X1-Kl
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:39 +0000
Received: from [193.109.254.147:23176] by server-4.bemta-14.messagelabs.com id
	5A/2B-17387-E8B33815; Fri, 03 May 2013 04:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1367554956!8662676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24217 invoked from network); 3 May 2013 04:22:37 -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;
	3 May 2013 04:22:37 -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 1UY7W0-0002kC-IC
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7W0-0004Wt-GK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:36 +0000
Date: Fri, 03 May 2013 04:22:36 +0000
Message-Id: <E1UY7W0-0004Wt-GK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make vcpu_reset() preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4939f9a6dee4280f38730fd3066e5dce353112f6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:37:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:37:24 2013 +0200

    x86: make vcpu_reset() preemptible
    
    ... as dropping the old page tables may take significant amounts of
    time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/domain.c     |    3 ++-
 xen/arch/x86/domain.c     |   13 ++++++-------
 xen/arch/x86/hvm/hvm.c    |    5 ++++-
 xen/arch/x86/hvm/vlapic.c |    5 ++++-
 xen/arch/x86/mm.c         |    6 +++---
 xen/common/domain.c       |   12 ++++++++++--
 xen/common/domctl.c       |   13 +++++++------
 xen/include/asm-x86/mm.h  |    2 +-
 xen/include/xen/domain.h  |    4 ++--
 xen/include/xen/sched.h   |    3 +++
 10 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2af40a1..141aa0b 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -566,9 +566,10 @@ int arch_set_info_guest(
     return 0;
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 static int relinquish_memory(struct domain *d, struct page_list_head *list)
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index bc1a31f..5bf52ff 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -939,17 +939,16 @@ int arch_set_info_guest(
 #undef c
 }
 
-void arch_vcpu_reset(struct vcpu *v)
+int arch_vcpu_reset(struct vcpu *v)
 {
     if ( !is_hvm_vcpu(v) )
     {
         destroy_gdt(v);
-        vcpu_destroy_pagetables(v, 0);
-    }
-    else
-    {
-        vcpu_end_shutdown_deferral(v);
+        return vcpu_destroy_pagetables(v);
     }
+
+    vcpu_end_shutdown_deferral(v);
+    return 0;
 }
 
 /* 
@@ -1960,7 +1959,7 @@ int domain_relinquish_resources(struct domain *d)
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
         {
-            ret = vcpu_destroy_pagetables(v, 1);
+            ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c8487b8..7c3cb15 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3555,8 +3555,11 @@ static void hvm_s3_suspend(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
+        int rc;
+
         vlapic_reset(vcpu_vlapic(v));
-        vcpu_reset(v);
+        rc = vcpu_reset(v);
+        ASSERT(!rc);
     }
 
     vpic_reset(d);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 9e1db88..8c6a7e2 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -240,6 +240,8 @@ static void vlapic_init_sipi_one(struct vcpu *target, uint32_t icr)
     {
     case APIC_DM_INIT: {
         bool_t fpu_initialised;
+        int rc;
+
         /* No work on INIT de-assert for P4-type APIC. */
         if ( (icr & (APIC_INT_LEVELTRIG | APIC_INT_ASSERT)) ==
              APIC_INT_LEVELTRIG )
@@ -251,7 +253,8 @@ static void vlapic_init_sipi_one(struct vcpu *target, uint32_t icr)
         domain_lock(target->domain);
         /* Reset necessary VCPU state. This does not include FPU state. */
         fpu_initialised = target->fpu_initialised;
-        vcpu_reset(target);
+        rc = vcpu_reset(target);
+        ASSERT(!rc);
         target->fpu_initialised = fpu_initialised;
         vlapic_reset(vcpu_vlapic(target));
         domain_unlock(target->domain);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index bada0bd..10e9217 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2598,7 +2598,7 @@ static int put_old_guest_table(struct vcpu *v)
     return rc;
 }
 
-int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
+int vcpu_destroy_pagetables(struct vcpu *v)
 {
     unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);
     struct page_info *page;
@@ -2620,7 +2620,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, preemptible);
+            rc = put_page_and_type_preemptible(page, 1);
     }
 
     if ( l4tab )
@@ -2641,7 +2641,7 @@ int vcpu_destroy_pagetables(struct vcpu *v, bool_t preemptible)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, preemptible);
+                rc = put_page_and_type_preemptible(page, 1);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
diff --git a/xen/common/domain.c b/xen/common/domain.c
index ce45d66..7cca655 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -868,14 +868,18 @@ void domain_unpause_by_systemcontroller(struct domain *d)
         domain_unpause(d);
 }
 
-void vcpu_reset(struct vcpu *v)
+int vcpu_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
+    int rc;
 
     vcpu_pause(v);
     domain_lock(d);
 
-    arch_vcpu_reset(v);
+    set_bit(_VPF_in_reset, &v->pause_flags);
+    rc = arch_vcpu_reset(v);
+    if ( rc )
+        goto out_unlock;
 
     set_bit(_VPF_down, &v->pause_flags);
 
@@ -891,9 +895,13 @@ void vcpu_reset(struct vcpu *v)
 #endif
     cpumask_clear(v->cpu_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
+ out_unlock:
     domain_unlock(v->domain);
     vcpu_unpause(v);
+
+    return rc;
 }
 
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 73b12c8..1d00cfc 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -332,13 +332,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
-            goto svc_out;
+            break;
 
         if ( guest_handle_is_null(op->u.vcpucontext.ctxt) )
         {
-            vcpu_reset(v);
-            ret = 0;
-            goto svc_out;
+            ret = vcpu_reset(v);
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
+            break;
         }
 
 #ifdef CONFIG_COMPAT
@@ -347,7 +349,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 #endif
         ret = -ENOMEM;
         if ( (c.nat = alloc_vcpu_guest_context()) == NULL )
-            goto svc_out;
+            break;
 
 #ifdef CONFIG_COMPAT
         if ( !is_pv_32on64_vcpu(v) )
@@ -368,7 +370,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             domain_unpause(d);
         }
 
-    svc_out:
         free_vcpu_guest_context(c.nat);
     }
     break;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 0f7297a..79c526f 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -556,7 +556,7 @@ void audit_domains(void);
 int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
-int vcpu_destroy_pagetables(struct vcpu *, bool_t preemptible);
+int vcpu_destroy_pagetables(struct vcpu *);
 void propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index d4ac50f..504a70f 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -13,7 +13,7 @@ typedef union {
 struct vcpu *alloc_vcpu(
     struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
 struct vcpu *alloc_dom0_vcpu0(void);
-void vcpu_reset(struct vcpu *v);
+int vcpu_reset(struct vcpu *);
 
 struct xen_domctl_getdomaininfo;
 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
@@ -67,7 +67,7 @@ void arch_dump_vcpu_info(struct vcpu *v);
 
 void arch_dump_domain_info(struct domain *d);
 
-void arch_vcpu_reset(struct vcpu *v);
+int arch_vcpu_reset(struct vcpu *);
 
 extern spinlock_t vcpu_alloc_lock;
 bool_t domctl_lock_acquire(void);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index beadc42..41f749e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -682,6 +682,9 @@ static inline struct domain *next_domain_in_cpupool(
  /* VCPU is blocked due to missing mem_sharing ring. */
 #define _VPF_mem_sharing     6
 #define VPF_mem_sharing      (1UL<<_VPF_mem_sharing)
+ /* VCPU is being reset. */
+#define _VPF_in_reset        7
+#define VPF_in_reset         (1UL<<_VPF_in_reset)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22: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 1UY7WF-0003Yq-KV; Fri, 03 May 2013 04:22: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 1UY7WE-0003YW-6t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:50 +0000
Received: from [193.109.254.147:63254] by server-15.bemta-14.messagelabs.com
	id 1A/89-14305-99B33815; Fri, 03 May 2013 04:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1367554967!8459394!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5737 invoked from network); 3 May 2013 04:22:48 -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;
	3 May 2013 04:22: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 1UY7WA-0002kI-OL
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7WA-0004XI-N9
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:46 +0000
Date: Fri, 03 May 2013 04:22:46 +0000
Message-Id: <E1UY7WA-0004XI-N9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make arch_set_info_guest()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 99d2b149915010e986f4d8778708c5891e7b4635
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:38:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:38:30 2013 +0200

    x86: make arch_set_info_guest() preemptible
    
    .. as the root page table validation (and the dropping of an eventual
    old one) can require meaningful amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain.c      |  113 ++++++++++++++++++++++++--------------------
 xen/common/compat/domain.c |    4 ++
 xen/common/domain.c        |    5 ++
 xen/common/domctl.c        |    4 ++
 4 files changed, 74 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5bf52ff..0baaa95 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -752,6 +752,9 @@ int arch_set_info_guest(
 
     if ( !v->is_initialised )
     {
+        if ( !compat && !(flags & VGCF_in_kernel) && !c.nat->ctrlreg[1] )
+            return -EINVAL;
+
         v->arch.pv_vcpu.ldt_base = c(ldt_base);
         v->arch.pv_vcpu.ldt_ents = c(ldt_ents);
     }
@@ -844,80 +847,86 @@ int arch_set_info_guest(
     if ( rc != 0 )
         return rc;
 
+    set_bit(_VPF_in_reset, &v->pause_flags);
+
     if ( !compat )
-    {
         cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-        if ( !paging_mode_refcounts(d)
-             && !get_page_type(cr3_page, PGT_base_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
+    else
+        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
+    cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
+    if ( !cr3_page )
+        rc = -EINVAL;
+    else if ( paging_mode_refcounts(d) )
+        /* nothing */;
+    else if ( cr3_page == v->arch.old_guest_table )
+    {
+        v->arch.old_guest_table = NULL;
+        put_page(cr3_page);
+    }
+    else
+    {
+        /*
+         * Since v->arch.guest_table{,_user} are both NULL, this effectively
+         * is just a call to put_old_guest_table().
+         */
+        if ( !compat )
+            rc = vcpu_destroy_pagetables(v);
+        if ( !rc )
+            rc = get_page_type_preemptible(cr3_page,
+                                           !compat ? PGT_root_page_table
+                                                   : PGT_l3_page_table);
+        if ( rc == -EINTR )
+            rc = -EAGAIN;
+    }
+    if ( rc )
+        /* handled below */;
+    else if ( !compat )
+    {
         v->arch.guest_table = pagetable_from_page(cr3_page);
         if ( c.nat->ctrlreg[1] )
         {
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
             cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
-            if ( !cr3_page ||
-                 (!paging_mode_refcounts(d)
-                  && !get_page_type(cr3_page, PGT_base_page_table)) )
+            if ( !cr3_page )
+                rc = -EINVAL;
+            else if ( !paging_mode_refcounts(d) )
             {
-                if (cr3_page)
-                    put_page(cr3_page);
-                cr3_page = pagetable_get_page(v->arch.guest_table);
-                v->arch.guest_table = pagetable_null();
-                if ( paging_mode_refcounts(d) )
-                    put_page(cr3_page);
-                else
-                    put_page_and_type(cr3_page);
-                destroy_gdt(v);
-                return -EINVAL;
+                rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
+                switch ( rc )
+                {
+                case -EINTR:
+                    rc = -EAGAIN;
+                case -EAGAIN:
+                    v->arch.old_guest_table =
+                        pagetable_get_page(v->arch.guest_table);
+                    v->arch.guest_table = pagetable_null();
+                    break;
+                }
             }
-
-            v->arch.guest_table_user = pagetable_from_page(cr3_page);
-        }
-        else if ( !(flags & VGCF_in_kernel) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
+            if ( !rc )
+               v->arch.guest_table_user = pagetable_from_page(cr3_page);
         }
     }
     else
     {
         l4_pgentry_t *l4tab;
 
-        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page)
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
-        if (!paging_mode_refcounts(d)
-            && !get_page_type(cr3_page, PGT_l3_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
         l4tab = map_domain_page(pagetable_get_pfn(v->arch.guest_table));
         *l4tab = l4e_from_pfn(page_to_mfn(cr3_page),
             _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
         unmap_domain_page(l4tab);
     }
+    if ( rc )
+    {
+        if ( cr3_page )
+            put_page(cr3_page);
+        destroy_gdt(v);
+        return rc;
+    }
+
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
     if ( v->vcpu_id == 0 )
         update_domain_wallclock_time(d);
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index aac8f46..44ba78d 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -50,6 +50,10 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, cmp_ctxt);
         domain_unlock(d);
 
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         xfree(cmp_ctxt);
         break;
     }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 7cca655..b5d44d4 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -938,6 +938,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         domain_unlock(d);
 
         free_vcpu_guest_context(ctxt);
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         break;
 
     case VCPUOP_up: {
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 1d00cfc..9bd8f80 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -368,6 +368,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             domain_pause(d);
             ret = arch_set_info_guest(v, c);
             domain_unpause(d);
+
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
         }
 
         free_vcpu_guest_context(c.nat);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:22:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:22: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 1UY7WF-0003Yq-KV; Fri, 03 May 2013 04:22: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 1UY7WE-0003YW-6t
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:50 +0000
Received: from [193.109.254.147:63254] by server-15.bemta-14.messagelabs.com
	id 1A/89-14305-99B33815; Fri, 03 May 2013 04:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1367554967!8459394!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5737 invoked from network); 3 May 2013 04:22:48 -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;
	3 May 2013 04:22: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 1UY7WA-0002kI-OL
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7WA-0004XI-N9
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:46 +0000
Date: Fri, 03 May 2013 04:22:46 +0000
Message-Id: <E1UY7WA-0004XI-N9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make arch_set_info_guest()
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 99d2b149915010e986f4d8778708c5891e7b4635
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:38:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:38:30 2013 +0200

    x86: make arch_set_info_guest() preemptible
    
    .. as the root page table validation (and the dropping of an eventual
    old one) can require meaningful amounts of time.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain.c      |  113 ++++++++++++++++++++++++--------------------
 xen/common/compat/domain.c |    4 ++
 xen/common/domain.c        |    5 ++
 xen/common/domctl.c        |    4 ++
 4 files changed, 74 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5bf52ff..0baaa95 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -752,6 +752,9 @@ int arch_set_info_guest(
 
     if ( !v->is_initialised )
     {
+        if ( !compat && !(flags & VGCF_in_kernel) && !c.nat->ctrlreg[1] )
+            return -EINVAL;
+
         v->arch.pv_vcpu.ldt_base = c(ldt_base);
         v->arch.pv_vcpu.ldt_ents = c(ldt_ents);
     }
@@ -844,80 +847,86 @@ int arch_set_info_guest(
     if ( rc != 0 )
         return rc;
 
+    set_bit(_VPF_in_reset, &v->pause_flags);
+
     if ( !compat )
-    {
         cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-        if ( !paging_mode_refcounts(d)
-             && !get_page_type(cr3_page, PGT_base_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
+    else
+        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
+    cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
+    if ( !cr3_page )
+        rc = -EINVAL;
+    else if ( paging_mode_refcounts(d) )
+        /* nothing */;
+    else if ( cr3_page == v->arch.old_guest_table )
+    {
+        v->arch.old_guest_table = NULL;
+        put_page(cr3_page);
+    }
+    else
+    {
+        /*
+         * Since v->arch.guest_table{,_user} are both NULL, this effectively
+         * is just a call to put_old_guest_table().
+         */
+        if ( !compat )
+            rc = vcpu_destroy_pagetables(v);
+        if ( !rc )
+            rc = get_page_type_preemptible(cr3_page,
+                                           !compat ? PGT_root_page_table
+                                                   : PGT_l3_page_table);
+        if ( rc == -EINTR )
+            rc = -EAGAIN;
+    }
+    if ( rc )
+        /* handled below */;
+    else if ( !compat )
+    {
         v->arch.guest_table = pagetable_from_page(cr3_page);
         if ( c.nat->ctrlreg[1] )
         {
             cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]);
             cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
 
-            if ( !cr3_page ||
-                 (!paging_mode_refcounts(d)
-                  && !get_page_type(cr3_page, PGT_base_page_table)) )
+            if ( !cr3_page )
+                rc = -EINVAL;
+            else if ( !paging_mode_refcounts(d) )
             {
-                if (cr3_page)
-                    put_page(cr3_page);
-                cr3_page = pagetable_get_page(v->arch.guest_table);
-                v->arch.guest_table = pagetable_null();
-                if ( paging_mode_refcounts(d) )
-                    put_page(cr3_page);
-                else
-                    put_page_and_type(cr3_page);
-                destroy_gdt(v);
-                return -EINVAL;
+                rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
+                switch ( rc )
+                {
+                case -EINTR:
+                    rc = -EAGAIN;
+                case -EAGAIN:
+                    v->arch.old_guest_table =
+                        pagetable_get_page(v->arch.guest_table);
+                    v->arch.guest_table = pagetable_null();
+                    break;
+                }
             }
-
-            v->arch.guest_table_user = pagetable_from_page(cr3_page);
-        }
-        else if ( !(flags & VGCF_in_kernel) )
-        {
-            destroy_gdt(v);
-            return -EINVAL;
+            if ( !rc )
+               v->arch.guest_table_user = pagetable_from_page(cr3_page);
         }
     }
     else
     {
         l4_pgentry_t *l4tab;
 
-        cr3_gfn = compat_cr3_to_pfn(c.cmp->ctrlreg[3]);
-        cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC);
-
-        if ( !cr3_page)
-        {
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
-        if (!paging_mode_refcounts(d)
-            && !get_page_type(cr3_page, PGT_l3_page_table) )
-        {
-            put_page(cr3_page);
-            destroy_gdt(v);
-            return -EINVAL;
-        }
-
         l4tab = map_domain_page(pagetable_get_pfn(v->arch.guest_table));
         *l4tab = l4e_from_pfn(page_to_mfn(cr3_page),
             _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED);
         unmap_domain_page(l4tab);
     }
+    if ( rc )
+    {
+        if ( cr3_page )
+            put_page(cr3_page);
+        destroy_gdt(v);
+        return rc;
+    }
+
+    clear_bit(_VPF_in_reset, &v->pause_flags);
 
     if ( v->vcpu_id == 0 )
         update_domain_wallclock_time(d);
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index aac8f46..44ba78d 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -50,6 +50,10 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         rc = v->is_initialised ? -EEXIST : arch_set_info_guest(v, cmp_ctxt);
         domain_unlock(d);
 
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         xfree(cmp_ctxt);
         break;
     }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 7cca655..b5d44d4 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -938,6 +938,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         domain_unlock(d);
 
         free_vcpu_guest_context(ctxt);
+
+        if ( rc == -EAGAIN )
+            rc = hypercall_create_continuation(__HYPERVISOR_vcpu_op, "iih",
+                                               cmd, vcpuid, arg);
+
         break;
 
     case VCPUOP_up: {
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 1d00cfc..9bd8f80 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -368,6 +368,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             domain_pause(d);
             ret = arch_set_info_guest(v, c);
             domain_unpause(d);
+
+            if ( ret == -EAGAIN )
+                ret = hypercall_create_continuation(
+                          __HYPERVISOR_domctl, "h", u_domctl);
         }
 
         free_vcpu_guest_context(c.nat);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:07 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7WQ-0003ag-RX; Fri, 03 May 2013 04:23:02 +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 1UY7WN-0003aC-Pp
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:59 +0000
Received: from [85.158.139.211:3409] by server-10.bemta-5.messagelabs.com id
	FD/26-19016-3AB33815; Fri, 03 May 2013 04:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367554977!21428570!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13716 invoked from network); 3 May 2013 04:22:58 -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;
	3 May 2013 04:22: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 1UY7WL-0002kR-7G
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7WK-0004Xf-SP
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:57 +0000
Date: Fri, 03 May 2013 04:22:56 +0000
Message-Id: <E1UY7WK-0004Xf-SP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make page table unpinning
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a3e049f8e86fe18e3b87f18dc0c7be665026fd9f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:39:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:39:06 2013 +0200

    x86: make page table unpinning preemptible
    
    ... as it may take significant amounts of time.
    
    Since we can't re-invoke the operation in a second attempt, the
    continuation logic must be slightly tweaked so that we make sure
    do_mmuext_op() gets run one more time even when the preempted unpin
    operation was the last one in a batch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c               |   40 +++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |   23 +++++++++++++++++----
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 10e9217..0dc9070 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2859,6 +2859,14 @@ long do_mmuext_op(
         return rc;
     }
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(uops)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
+
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
         count &= ~MMU_UPDATE_PREEMPTED;
@@ -2889,7 +2897,7 @@ long do_mmuext_op(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3009,7 +3017,17 @@ long do_mmuext_op(
                 break;
             }
 
-            put_page_and_type(page);
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                rc = 0;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
             put_page(page);
 
             /* A page is dirtied when its pin status is cleared. */
@@ -3318,9 +3336,27 @@ long do_mmuext_op(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmuext_op, "hihi",
             uops, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE_PARAM(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmuext_op, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 9adc4b4..f01f8ff 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -268,6 +268,13 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
     int rc = 0;
     XEN_GUEST_HANDLE_PARAM(mmuext_op_t) nat_ops;
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(cmp_uops)) )
+    {
+        set_xen_guest_handle(nat_ops, NULL);
+        return do_mmuext_op(nat_ops, count, pdone, foreigndom);
+    }
+
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
 
@@ -370,12 +377,18 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
                 left = 1;
-                BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops, cmp_uops));
-                BUG_ON(left != arg1);
-                if (!test_bit(_MCSF_in_multicall, &mcs->flags))
-                    regs->_ecx += count - i;
+                if ( arg1 != MMU_UPDATE_PREEMPTED )
+                {
+                    BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops,
+                                                        cmp_uops));
+                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                        regs->_ecx += count - i;
+                    else
+                        mcs->compat_call.args[1] += count - i;
+                }
                 else
-                    mcs->compat_call.args[1] += count - i;
+                    BUG_ON(hypercall_xlat_continuation(&left, 0));
+                BUG_ON(left != arg1);
             }
             else
                 BUG_ON(err > 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:07 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7WQ-0003ag-RX; Fri, 03 May 2013 04:23:02 +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 1UY7WN-0003aC-Pp
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:59 +0000
Received: from [85.158.139.211:3409] by server-10.bemta-5.messagelabs.com id
	FD/26-19016-3AB33815; Fri, 03 May 2013 04:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367554977!21428570!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13716 invoked from network); 3 May 2013 04:22:58 -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;
	3 May 2013 04:22: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 1UY7WL-0002kR-7G
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7WK-0004Xf-SP
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:22:57 +0000
Date: Fri, 03 May 2013 04:22:56 +0000
Message-Id: <E1UY7WK-0004Xf-SP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make page table unpinning
	preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a3e049f8e86fe18e3b87f18dc0c7be665026fd9f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:39:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:39:06 2013 +0200

    x86: make page table unpinning preemptible
    
    ... as it may take significant amounts of time.
    
    Since we can't re-invoke the operation in a second attempt, the
    continuation logic must be slightly tweaked so that we make sure
    do_mmuext_op() gets run one more time even when the preempted unpin
    operation was the last one in a batch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c               |   40 +++++++++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/compat/mm.c |   23 +++++++++++++++++----
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 10e9217..0dc9070 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2859,6 +2859,14 @@ long do_mmuext_op(
         return rc;
     }
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(uops)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
+
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
         count &= ~MMU_UPDATE_PREEMPTED;
@@ -2889,7 +2897,7 @@ long do_mmuext_op(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3009,7 +3017,17 @@ long do_mmuext_op(
                 break;
             }
 
-            put_page_and_type(page);
+            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            {
+            case -EINTR:
+            case -EAGAIN:
+                curr->arch.old_guest_table = page;
+                rc = 0;
+                break;
+            default:
+                BUG_ON(rc);
+                break;
+            }
             put_page(page);
 
             /* A page is dirtied when its pin status is cleared. */
@@ -3318,9 +3336,27 @@ long do_mmuext_op(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmuext_op, "hihi",
             uops, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE_PARAM(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmuext_op, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 9adc4b4..f01f8ff 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -268,6 +268,13 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
     int rc = 0;
     XEN_GUEST_HANDLE_PARAM(mmuext_op_t) nat_ops;
 
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(cmp_uops)) )
+    {
+        set_xen_guest_handle(nat_ops, NULL);
+        return do_mmuext_op(nat_ops, count, pdone, foreigndom);
+    }
+
     preempt_mask = count & MMU_UPDATE_PREEMPTED;
     count ^= preempt_mask;
 
@@ -370,12 +377,18 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                 guest_handle_add_offset(nat_ops, i - left);
                 guest_handle_subtract_offset(cmp_uops, left);
                 left = 1;
-                BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops, cmp_uops));
-                BUG_ON(left != arg1);
-                if (!test_bit(_MCSF_in_multicall, &mcs->flags))
-                    regs->_ecx += count - i;
+                if ( arg1 != MMU_UPDATE_PREEMPTED )
+                {
+                    BUG_ON(!hypercall_xlat_continuation(&left, 0x01, nat_ops,
+                                                        cmp_uops));
+                    if ( !test_bit(_MCSF_in_multicall, &mcs->flags) )
+                        regs->_ecx += count - i;
+                    else
+                        mcs->compat_call.args[1] += count - i;
+                }
                 else
-                    mcs->compat_call.args[1] += count - i;
+                    BUG_ON(hypercall_xlat_continuation(&left, 0));
+                BUG_ON(left != arg1);
             }
             else
                 BUG_ON(err > 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7WZ-0003cZ-Uc; Fri, 03 May 2013 04:23:11 +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 1UY7WY-0003cC-Hk
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:10 +0000
Received: from [85.158.143.99:57215] by server-3.bemta-4.messagelabs.com id
	04/35-02015-DAB33815; Fri, 03 May 2013 04:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367554987!27840430!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14291 invoked from network); 3 May 2013 04:23:08 -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;
	3 May 2013 04:23: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 1UY7WV-0002kz-FG
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7WV-0004Yf-E0
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:07 +0000
Date: Fri, 03 May 2013 04:23:07 +0000
Message-Id: <E1UY7WV-0004Yf-E0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make page table handling error
	paths preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b8efae696c9a2d46e91fa0eda739427efc16c250
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:39:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:39:37 2013 +0200

    x86: make page table handling error paths preemptible
    
    ... as they may take significant amounts of time.
    
    This requires cloning the tweaked continuation logic from
    do_mmuext_op() to do_mmu_update().
    
    Note that in mod_l[34]_entry() a negative "preemptible" value gets
    passed to put_page_from_l[34]e() now, telling the callee to store the
    respective page in current->arch.old_guest_table (for a hypercall
    continuation to pick up), rather than carrying out the put right away.
    This is going to be made a little more explicit by a subsequent cleanup
    patch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c |  125 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 98 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0dc9070..051e06e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1139,7 +1139,16 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
     }
 
     if ( unlikely(partial > 0) )
+    {
+        ASSERT(preemptible >= 0);
         return __put_page_type(l3e_get_page(l3e), preemptible);
+    }
+
+    if ( preemptible < 0 )
+    {
+        current->arch.old_guest_table = l3e_get_page(l3e);
+        return 0;
+    }
 
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
@@ -1151,7 +1160,17 @@ static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
          (l4e_get_pfn(l4e) != pfn) )
     {
         if ( unlikely(partial > 0) )
+        {
+            ASSERT(preemptible >= 0);
             return __put_page_type(l4e_get_page(l4e), preemptible);
+        }
+
+        if ( preemptible < 0 )
+        {
+            current->arch.old_guest_table = l4e_get_page(l4e);
+            return 0;
+        }
+
         return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
     }
     return 1;
@@ -1347,12 +1366,17 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
     if ( rc < 0 && rc != -EAGAIN && rc != -EINTR )
     {
         MEM_LOG("Failure in alloc_l3_table: entry %d", i);
+        if ( i )
+        {
+            page->nr_validated_ptes = i;
+            page->partial_pte = 0;
+            current->arch.old_guest_table = page;
+        }
         while ( i-- > 0 )
         {
             if ( !is_guest_l3_slot(i) )
                 continue;
             unadjust_guest_l3e(pl3e[i], d);
-            put_page_from_l3e(pl3e[i], pfn, 0, 0);
         }
     }
 
@@ -1398,22 +1422,24 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
             page->nr_validated_ptes = i;
             page->partial_pte = partial ?: 1;
         }
-        else if ( rc == -EINTR )
+        else if ( rc < 0 )
         {
+            if ( rc != -EINTR )
+                MEM_LOG("Failure in alloc_l4_table: entry %d", i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
                 page->partial_pte = 0;
-                rc = -EAGAIN;
+                if ( rc == -EINTR )
+                    rc = -EAGAIN;
+                else
+                {
+                    if ( current->arch.old_guest_table )
+                        page->nr_validated_ptes++;
+                    current->arch.old_guest_table = page;
+                }
             }
         }
-        else if ( rc < 0 )
-        {
-            MEM_LOG("Failure in alloc_l4_table: entry %d", i);
-            while ( i-- > 0 )
-                if ( is_guest_l4_slot(d, i) )
-                    put_page_from_l4e(pl4e[i], pfn, 0, 0);
-        }
         if ( rc < 0 )
         {
             unmap_domain_page(pl4e);
@@ -1846,7 +1872,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         if ( !create_pae_xen_mappings(d, pl3e) )
             BUG();
 
-    put_page_from_l3e(ol3e, pfn, 0, 0);
+    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -1907,7 +1933,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, 0);
+    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2063,7 +2089,15 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
                 page_to_mfn(page), get_gpfn_from_mfn(page_to_mfn(page)),
                 type, page->count_info, page->u.inuse.type_info);
-        page->u.inuse.type_info = 0;
+        if ( page != current->arch.old_guest_table )
+            page->u.inuse.type_info = 0;
+        else
+        {
+            ASSERT((page->u.inuse.type_info &
+                    (PGT_count_mask | PGT_validated)) == 1);
+            get_page_light(page);
+            page->u.inuse.type_info |= PGT_partial;
+        }
     }
     else
     {
@@ -2961,21 +2995,17 @@ long do_mmuext_op(
             }
 
             if ( (rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page)) != 0 )
-            {
-                put_page_and_type(page);
                 okay = 0;
-                break;
-            }
-
-            if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                           &page->u.inuse.type_info)) )
+            else if ( unlikely(test_and_set_bit(_PGT_pinned,
+                                                &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", page_to_mfn(page));
-                put_page_and_type(page);
                 okay = 0;
-                break;
             }
 
+            if ( unlikely(!okay) )
+                goto pin_drop;
+
             /* A page is dirtied when its pin status is set. */
             paging_mark_dirty(pg_owner, page_to_mfn(page));
 
@@ -2989,7 +3019,13 @@ long do_mmuext_op(
                                                &page->u.inuse.type_info));
                 spin_unlock(&pg_owner->page_alloc_lock);
                 if ( drop_ref )
-                    put_page_and_type(page);
+                {
+        pin_drop:
+                    if ( type == PGT_l1_page_table )
+                        put_page_and_type(page);
+                    else
+                        curr->arch.old_guest_table = page;
+                }
             }
 
             break;
@@ -3383,13 +3419,30 @@ long do_mmu_update(
     void *va;
     unsigned long gpfn, gmfn, mfn;
     struct page_info *page;
-    int rc = 0, i = 0;
-    unsigned int cmd, done = 0, pt_dom;
-    struct vcpu *v = current;
+    unsigned int cmd, i = 0, done = 0, pt_dom;
+    struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
+    int rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmu_update, "hihi", ureqs, count, pdone,
+                     foreigndom);
+        return rc;
+    }
+
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(ureqs)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3433,7 +3486,7 @@ long do_mmu_update(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3628,9 +3681,27 @@ long do_mmu_update(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmu_update, "hihi",
             ureqs, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE_PARAM(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmu_update, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7WZ-0003cZ-Uc; Fri, 03 May 2013 04:23:11 +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 1UY7WY-0003cC-Hk
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:10 +0000
Received: from [85.158.143.99:57215] by server-3.bemta-4.messagelabs.com id
	04/35-02015-DAB33815; Fri, 03 May 2013 04:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367554987!27840430!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14291 invoked from network); 3 May 2013 04:23:08 -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;
	3 May 2013 04:23: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 1UY7WV-0002kz-FG
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7WV-0004Yf-E0
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:07 +0000
Date: Fri, 03 May 2013 04:23:07 +0000
Message-Id: <E1UY7WV-0004Yf-E0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make page table handling error
	paths preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b8efae696c9a2d46e91fa0eda739427efc16c250
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:39:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:39:37 2013 +0200

    x86: make page table handling error paths preemptible
    
    ... as they may take significant amounts of time.
    
    This requires cloning the tweaked continuation logic from
    do_mmuext_op() to do_mmu_update().
    
    Note that in mod_l[34]_entry() a negative "preemptible" value gets
    passed to put_page_from_l[34]e() now, telling the callee to store the
    respective page in current->arch.old_guest_table (for a hypercall
    continuation to pick up), rather than carrying out the put right away.
    This is going to be made a little more explicit by a subsequent cleanup
    patch.
    
    This is part of CVE-2013-1918 / XSA-45.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c |  125 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 98 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0dc9070..051e06e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1139,7 +1139,16 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
     }
 
     if ( unlikely(partial > 0) )
+    {
+        ASSERT(preemptible >= 0);
         return __put_page_type(l3e_get_page(l3e), preemptible);
+    }
+
+    if ( preemptible < 0 )
+    {
+        current->arch.old_guest_table = l3e_get_page(l3e);
+        return 0;
+    }
 
     return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
 }
@@ -1151,7 +1160,17 @@ static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
          (l4e_get_pfn(l4e) != pfn) )
     {
         if ( unlikely(partial > 0) )
+        {
+            ASSERT(preemptible >= 0);
             return __put_page_type(l4e_get_page(l4e), preemptible);
+        }
+
+        if ( preemptible < 0 )
+        {
+            current->arch.old_guest_table = l4e_get_page(l4e);
+            return 0;
+        }
+
         return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
     }
     return 1;
@@ -1347,12 +1366,17 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
     if ( rc < 0 && rc != -EAGAIN && rc != -EINTR )
     {
         MEM_LOG("Failure in alloc_l3_table: entry %d", i);
+        if ( i )
+        {
+            page->nr_validated_ptes = i;
+            page->partial_pte = 0;
+            current->arch.old_guest_table = page;
+        }
         while ( i-- > 0 )
         {
             if ( !is_guest_l3_slot(i) )
                 continue;
             unadjust_guest_l3e(pl3e[i], d);
-            put_page_from_l3e(pl3e[i], pfn, 0, 0);
         }
     }
 
@@ -1398,22 +1422,24 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
             page->nr_validated_ptes = i;
             page->partial_pte = partial ?: 1;
         }
-        else if ( rc == -EINTR )
+        else if ( rc < 0 )
         {
+            if ( rc != -EINTR )
+                MEM_LOG("Failure in alloc_l4_table: entry %d", i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
                 page->partial_pte = 0;
-                rc = -EAGAIN;
+                if ( rc == -EINTR )
+                    rc = -EAGAIN;
+                else
+                {
+                    if ( current->arch.old_guest_table )
+                        page->nr_validated_ptes++;
+                    current->arch.old_guest_table = page;
+                }
             }
         }
-        else if ( rc < 0 )
-        {
-            MEM_LOG("Failure in alloc_l4_table: entry %d", i);
-            while ( i-- > 0 )
-                if ( is_guest_l4_slot(d, i) )
-                    put_page_from_l4e(pl4e[i], pfn, 0, 0);
-        }
         if ( rc < 0 )
         {
             unmap_domain_page(pl4e);
@@ -1846,7 +1872,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         if ( !create_pae_xen_mappings(d, pl3e) )
             BUG();
 
-    put_page_from_l3e(ol3e, pfn, 0, 0);
+    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -1907,7 +1933,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, 0);
+    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
     return rc;
 }
 
@@ -2063,7 +2089,15 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
                 page_to_mfn(page), get_gpfn_from_mfn(page_to_mfn(page)),
                 type, page->count_info, page->u.inuse.type_info);
-        page->u.inuse.type_info = 0;
+        if ( page != current->arch.old_guest_table )
+            page->u.inuse.type_info = 0;
+        else
+        {
+            ASSERT((page->u.inuse.type_info &
+                    (PGT_count_mask | PGT_validated)) == 1);
+            get_page_light(page);
+            page->u.inuse.type_info |= PGT_partial;
+        }
     }
     else
     {
@@ -2961,21 +2995,17 @@ long do_mmuext_op(
             }
 
             if ( (rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page)) != 0 )
-            {
-                put_page_and_type(page);
                 okay = 0;
-                break;
-            }
-
-            if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                           &page->u.inuse.type_info)) )
+            else if ( unlikely(test_and_set_bit(_PGT_pinned,
+                                                &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", page_to_mfn(page));
-                put_page_and_type(page);
                 okay = 0;
-                break;
             }
 
+            if ( unlikely(!okay) )
+                goto pin_drop;
+
             /* A page is dirtied when its pin status is set. */
             paging_mark_dirty(pg_owner, page_to_mfn(page));
 
@@ -2989,7 +3019,13 @@ long do_mmuext_op(
                                                &page->u.inuse.type_info));
                 spin_unlock(&pg_owner->page_alloc_lock);
                 if ( drop_ref )
-                    put_page_and_type(page);
+                {
+        pin_drop:
+                    if ( type == PGT_l1_page_table )
+                        put_page_and_type(page);
+                    else
+                        curr->arch.old_guest_table = page;
+                }
             }
 
             break;
@@ -3383,13 +3419,30 @@ long do_mmu_update(
     void *va;
     unsigned long gpfn, gmfn, mfn;
     struct page_info *page;
-    int rc = 0, i = 0;
-    unsigned int cmd, done = 0, pt_dom;
-    struct vcpu *v = current;
+    unsigned int cmd, i = 0, done = 0, pt_dom;
+    struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     struct domain_mmap_cache mapcache;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
+    int rc = put_old_guest_table(curr);
+
+    if ( unlikely(rc) )
+    {
+        if ( likely(rc == -EAGAIN) )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_mmu_update, "hihi", ureqs, count, pdone,
+                     foreigndom);
+        return rc;
+    }
+
+    if ( unlikely(count == MMU_UPDATE_PREEMPTED) &&
+         likely(guest_handle_is_null(ureqs)) )
+    {
+        /* See the curr->arch.old_guest_table related
+         * hypercall_create_continuation() below. */
+        return (int)foreigndom;
+    }
 
     if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
     {
@@ -3433,7 +3486,7 @@ long do_mmu_update(
 
     for ( i = 0; i < count; i++ )
     {
-        if ( hypercall_preempt_check() )
+        if ( curr->arch.old_guest_table || hypercall_preempt_check() )
         {
             rc = -EAGAIN;
             break;
@@ -3628,9 +3681,27 @@ long do_mmu_update(
     }
 
     if ( rc == -EAGAIN )
+    {
+        ASSERT(i < count);
         rc = hypercall_create_continuation(
             __HYPERVISOR_mmu_update, "hihi",
             ureqs, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+    }
+    else if ( curr->arch.old_guest_table )
+    {
+        XEN_GUEST_HANDLE_PARAM(void) null;
+
+        ASSERT(rc || i == count);
+        set_xen_guest_handle(null, NULL);
+        /*
+         * In order to have a way to communicate the final return value to
+         * our continuation, we pass this in place of "foreigndom", building
+         * on the fact that this argument isn't needed anymore.
+         */
+        rc = hypercall_create_continuation(
+                __HYPERVISOR_mmu_update, "hihi", null,
+                MMU_UPDATE_PREEMPTED, null, rc);
+    }
 
     put_pg_owner(pg_owner);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7Wl-0003eh-1X; Fri, 03 May 2013 04:23: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 1UY7Wj-0003eA-3q
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:21 +0000
Received: from [85.158.137.99:16694] by server-2.bemta-3.messagelabs.com id
	D7/F4-07011-8BB33815; Fri, 03 May 2013 04:23:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1367554998!20284542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29930 invoked from network); 3 May 2013 04:23:19 -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;
	3 May 2013 04:23: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 1UY7Wf-0002l5-R4
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Wf-0004Z3-JI
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:17 +0000
Date: Fri, 03 May 2013 04:23:17 +0000
Message-Id: <E1UY7Wf-0004Z3-JI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow Dom0 read-only access to
	IO-APICs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 d1222afda4d27916580c28533762e362d64ace22
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:46:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:46:02 2013 +0200

    x86: allow Dom0 read-only access to IO-APICs
    
    There are BIOSes that want to map the IO-APIC MMIO region from some
    ACPI method(s), and there is at least one BIOS flavor that wants to
    use this mapping to clear an RTE's mask bit. While we can't allow the
    latter, we can permit reads and simply drop write attempts, leveraging
    the already existing infrastructure introduced for dealing with AMD
    IOMMUs' representation as PCI devices.
    
    This fixes an interrupt setup problem on a system where _CRS evaluation
    involved the above described BIOS/ACPI behavior, and is expected to
    also deal with a boot time crash of pv-ops Linux upon encountering the
    same kind of system.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain_build.c   |    2 +-
 xen/arch/x86/io_apic.c        |    5 +++++
 xen/arch/x86/mm.c             |    2 ++
 xen/arch/x86/setup.c          |    3 +++
 xen/drivers/passthrough/io.c  |    2 --
 xen/drivers/passthrough/pci.c |    2 --
 xen/include/asm-x86/mm.h      |    2 ++
 xen/include/xen/iommu.h       |    2 --
 8 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 7ae084f..9980ea2 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1114,7 +1114,7 @@ int __init construct_dom0(
     for ( i = 0; i < nr_ioapics; i++ )
     {
         mfn = paddr_to_pfn(mp_ioapics[i].mpc_apicaddr);
-        if ( smp_found_config )
+        if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             rc |= iomem_deny_access(dom0, mfn, mfn);
     }
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index b5c4c5b..66c532a 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2507,6 +2507,11 @@ void __init init_ioapic_mappings(void)
             reg_01.raw = io_apic_read(i, 1);
             nr_ioapic_entries[i] = reg_01.bits.entries + 1;
             nr_irqs_gsi += nr_ioapic_entries[i];
+
+            if ( rangeset_add_singleton(mmio_ro_ranges,
+                                        ioapic_phys >> PAGE_SHIFT) )
+                printk(KERN_ERR "Failed to mark IO-APIC page %lx read-only\n",
+                       ioapic_phys);
         }
     }
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 051e06e..aef98d5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -151,6 +151,8 @@ unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
 
 bool_t __read_mostly machine_to_phys_mapping_valid = 0;
 
+struct rangeset *__read_mostly mmio_ro_ranges;
+
 #define PAGE_CACHE_ATTRS (_PAGE_PAT|_PAGE_PCD|_PAGE_PWT)
 
 bool_t __read_mostly opt_allow_superpage;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 43301a5..be541cb 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1216,6 +1216,9 @@ void __init __start_xen(unsigned long mbi_p)
     /* Low mappings were only needed for some BIOS table parsing. */
     zap_low_mappings();
 
+    mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
+                                  RANGESETF_prettyprint_hex);
+
     init_apic_mappings();
 
     normalise_cpu_order();
diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index 13002c0..f64e4ac 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -27,8 +27,6 @@
 #include <xen/hvm/irq.h>
 #include <xen/tasklet.h>
 
-struct rangeset *__read_mostly mmio_ro_ranges;
-
 static void hvm_dirq_assist(unsigned long _d);
 
 bool_t pt_irq_need_timer(uint32_t flags)
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 9635d93..f2756c9 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -105,8 +105,6 @@ void __init pt_pci_init(void)
     radix_tree_init(&pci_segments);
     if ( !alloc_pseg(0) )
         panic("Could not initialize PCI segment 0\n");
-    mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
-                                  RANGESETF_prettyprint_hex);
 }
 
 int __init pci_add_segment(u16 seg)
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 79c526f..7a92737 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -500,6 +500,8 @@ extern bool_t machine_to_phys_mapping_valid;
         _set_gpfn_from_mfn(mfn, pfn);           \
 } while (0)
 
+extern struct rangeset *mmio_ro_ranges;
+
 #define get_gpfn_from_mfn(mfn)      (machine_to_phys_mapping[(mfn)])
 
 #define mfn_to_gmfn(_d, mfn)                            \
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 8f04997..6f0ff9d 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -37,8 +37,6 @@ extern bool_t amd_iommu_perdev_intremap;
 /* Does this domain have a P2M table we can use as its IOMMU pagetable? */
 #define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share)
 
-extern struct rangeset *mmio_ro_ranges;
-
 #define domain_hvm_iommu(d)     (&d->arch.hvm_domain.hvm_iommu)
 
 #define MAX_IOMMUS 32
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7Wl-0003eh-1X; Fri, 03 May 2013 04:23: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 1UY7Wj-0003eA-3q
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:21 +0000
Received: from [85.158.137.99:16694] by server-2.bemta-3.messagelabs.com id
	D7/F4-07011-8BB33815; Fri, 03 May 2013 04:23:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1367554998!20284542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29930 invoked from network); 3 May 2013 04:23:19 -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;
	3 May 2013 04:23: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 1UY7Wf-0002l5-R4
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Wf-0004Z3-JI
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:17 +0000
Date: Fri, 03 May 2013 04:23:17 +0000
Message-Id: <E1UY7Wf-0004Z3-JI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow Dom0 read-only access to
	IO-APICs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 d1222afda4d27916580c28533762e362d64ace22
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:46:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:46:02 2013 +0200

    x86: allow Dom0 read-only access to IO-APICs
    
    There are BIOSes that want to map the IO-APIC MMIO region from some
    ACPI method(s), and there is at least one BIOS flavor that wants to
    use this mapping to clear an RTE's mask bit. While we can't allow the
    latter, we can permit reads and simply drop write attempts, leveraging
    the already existing infrastructure introduced for dealing with AMD
    IOMMUs' representation as PCI devices.
    
    This fixes an interrupt setup problem on a system where _CRS evaluation
    involved the above described BIOS/ACPI behavior, and is expected to
    also deal with a boot time crash of pv-ops Linux upon encountering the
    same kind of system.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain_build.c   |    2 +-
 xen/arch/x86/io_apic.c        |    5 +++++
 xen/arch/x86/mm.c             |    2 ++
 xen/arch/x86/setup.c          |    3 +++
 xen/drivers/passthrough/io.c  |    2 --
 xen/drivers/passthrough/pci.c |    2 --
 xen/include/asm-x86/mm.h      |    2 ++
 xen/include/xen/iommu.h       |    2 --
 8 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 7ae084f..9980ea2 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1114,7 +1114,7 @@ int __init construct_dom0(
     for ( i = 0; i < nr_ioapics; i++ )
     {
         mfn = paddr_to_pfn(mp_ioapics[i].mpc_apicaddr);
-        if ( smp_found_config )
+        if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
             rc |= iomem_deny_access(dom0, mfn, mfn);
     }
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index b5c4c5b..66c532a 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2507,6 +2507,11 @@ void __init init_ioapic_mappings(void)
             reg_01.raw = io_apic_read(i, 1);
             nr_ioapic_entries[i] = reg_01.bits.entries + 1;
             nr_irqs_gsi += nr_ioapic_entries[i];
+
+            if ( rangeset_add_singleton(mmio_ro_ranges,
+                                        ioapic_phys >> PAGE_SHIFT) )
+                printk(KERN_ERR "Failed to mark IO-APIC page %lx read-only\n",
+                       ioapic_phys);
         }
     }
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 051e06e..aef98d5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -151,6 +151,8 @@ unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
 
 bool_t __read_mostly machine_to_phys_mapping_valid = 0;
 
+struct rangeset *__read_mostly mmio_ro_ranges;
+
 #define PAGE_CACHE_ATTRS (_PAGE_PAT|_PAGE_PCD|_PAGE_PWT)
 
 bool_t __read_mostly opt_allow_superpage;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 43301a5..be541cb 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1216,6 +1216,9 @@ void __init __start_xen(unsigned long mbi_p)
     /* Low mappings were only needed for some BIOS table parsing. */
     zap_low_mappings();
 
+    mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
+                                  RANGESETF_prettyprint_hex);
+
     init_apic_mappings();
 
     normalise_cpu_order();
diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index 13002c0..f64e4ac 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -27,8 +27,6 @@
 #include <xen/hvm/irq.h>
 #include <xen/tasklet.h>
 
-struct rangeset *__read_mostly mmio_ro_ranges;
-
 static void hvm_dirq_assist(unsigned long _d);
 
 bool_t pt_irq_need_timer(uint32_t flags)
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 9635d93..f2756c9 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -105,8 +105,6 @@ void __init pt_pci_init(void)
     radix_tree_init(&pci_segments);
     if ( !alloc_pseg(0) )
         panic("Could not initialize PCI segment 0\n");
-    mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
-                                  RANGESETF_prettyprint_hex);
 }
 
 int __init pci_add_segment(u16 seg)
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 79c526f..7a92737 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -500,6 +500,8 @@ extern bool_t machine_to_phys_mapping_valid;
         _set_gpfn_from_mfn(mfn, pfn);           \
 } while (0)
 
+extern struct rangeset *mmio_ro_ranges;
+
 #define get_gpfn_from_mfn(mfn)      (machine_to_phys_mapping[(mfn)])
 
 #define mfn_to_gmfn(_d, mfn)                            \
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 8f04997..6f0ff9d 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -37,8 +37,6 @@ extern bool_t amd_iommu_perdev_intremap;
 /* Does this domain have a P2M table we can use as its IOMMU pagetable? */
 #define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share)
 
-extern struct rangeset *mmio_ro_ranges;
-
 #define domain_hvm_iommu(d)     (&d->arch.hvm_domain.hvm_iommu)
 
 #define MAX_IOMMUS 32
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7Wv-0003h0-6c; Fri, 03 May 2013 04:23:33 +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 1UY7Wt-0003gP-2d
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:31 +0000
Received: from [85.158.138.51:10846] by server-5.bemta-3.messagelabs.com id
	A4/C6-29713-2CB33815; Fri, 03 May 2013 04:23:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1367555008!11268778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13681 invoked from network); 3 May 2013 04:23:29 -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;
	3 May 2013 04:23: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 1UY7Wq-0002lE-09
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Wp-0004ZP-UW
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:27 +0000
Date: Fri, 03 May 2013 04:23:27 +0000
Message-Id: <E1UY7Wp-0004ZP-UW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: fix processing of RTC REG_B
	writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4919015901061942923=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit c2f79c464849e5f796aa9d1d0f26fe356abd1a1a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:47:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:47:32 2013 +0200

    x86/HVM: fix processing of RTC REG_B writes
    
    We must store the new values before calling rtc_update_irq(), and we
    need to call rtc_timer_update() when PIE transitions from 0 to 1 (as we
    may have previously turned off the periodic timer due to the guest not
    reading REG_C, and hence may have to re-enable it in order to start
    IRQs getting delivered to the guest).
    
    Note that the timer is being kept running if PIE transitions from 1 to
    0, to match the behavior of keeping it running for a brief period of
    time if the guest doesn't clear PF in time (in order to avoid
    permanently destroying and re-creating the periodic timer).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/hvm/rtc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 26ab12c..b728d5e 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -468,12 +468,14 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
             if ( orig & RTC_SET )
                 rtc_set_time(s);
         }
+        s->hw.cmos_data[RTC_REG_B] = data;
         /*
          * If the interrupt is already set when the interrupt becomes
          * enabled, raise an interrupt immediately.
          */
         rtc_update_irq(s);
-        s->hw.cmos_data[RTC_REG_B] = data;
+        if ( (data & RTC_PIE) && !(orig & RTC_PIE) )
+            rtc_timer_update(s);
         if ( (data ^ orig) & RTC_SET )
             check_update_timer(s);
         if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4919015901061942923==
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
--===============4919015901061942923==--

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7Wv-0003h0-6c; Fri, 03 May 2013 04:23:33 +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 1UY7Wt-0003gP-2d
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:31 +0000
Received: from [85.158.138.51:10846] by server-5.bemta-3.messagelabs.com id
	A4/C6-29713-2CB33815; Fri, 03 May 2013 04:23:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1367555008!11268778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13681 invoked from network); 3 May 2013 04:23:29 -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;
	3 May 2013 04:23: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 1UY7Wq-0002lE-09
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Wp-0004ZP-UW
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:27 +0000
Date: Fri, 03 May 2013 04:23:27 +0000
Message-Id: <E1UY7Wp-0004ZP-UW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: fix processing of RTC REG_B
	writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4919015901061942923=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit c2f79c464849e5f796aa9d1d0f26fe356abd1a1a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:47:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:47:32 2013 +0200

    x86/HVM: fix processing of RTC REG_B writes
    
    We must store the new values before calling rtc_update_irq(), and we
    need to call rtc_timer_update() when PIE transitions from 0 to 1 (as we
    may have previously turned off the periodic timer due to the guest not
    reading REG_C, and hence may have to re-enable it in order to start
    IRQs getting delivered to the guest).
    
    Note that the timer is being kept running if PIE transitions from 1 to
    0, to match the behavior of keeping it running for a brief period of
    time if the guest doesn't clear PF in time (in order to avoid
    permanently destroying and re-creating the periodic timer).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/hvm/rtc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 26ab12c..b728d5e 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -468,12 +468,14 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
             if ( orig & RTC_SET )
                 rtc_set_time(s);
         }
+        s->hw.cmos_data[RTC_REG_B] = data;
         /*
          * If the interrupt is already set when the interrupt becomes
          * enabled, raise an interrupt immediately.
          */
         rtc_update_irq(s);
-        s->hw.cmos_data[RTC_REG_B] = data;
+        if ( (data & RTC_PIE) && !(orig & RTC_PIE) )
+            rtc_timer_update(s);
         if ( (data ^ orig) & RTC_SET )
             check_update_timer(s);
         if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4919015901061942923==
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
--===============4919015901061942923==--

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7X3-0003ib-9c; Fri, 03 May 2013 04:23: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 1UY7X2-0003iO-Kg
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:40 +0000
Received: from [85.158.139.211:24542] by server-9.bemta-5.messagelabs.com id
	6B/E2-14875-BCB33815; Fri, 03 May 2013 04:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1367555018!21107060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2446 invoked from network); 3 May 2013 04:23:39 -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;
	3 May 2013 04:23: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 1UY7X0-0002lJ-6B
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7X0-0004Zp-4y
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:38 +0000
Date: Fri, 03 May 2013 04:23:38 +0000
Message-Id: <E1UY7X0-0004Zp-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: fix legacy PIC check in
	pt_update_irq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5485279458442214323=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit f6b533308cd8a776bbb947f6084efc63218ad28b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:48:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:48:22 2013 +0200

    x86/HVM: fix legacy PIC check in pt_update_irq()
    
    Depending on the IRQ we need to
    - not look at the PIC at all is this is the LAPIC timer (in that case
      we're dealing with a vector number rather than an IRQ one),
    - not look at the PIC for any non-legacy interrupt,
    - look at the correct PIC for the IRQ (which will always be PIC 2 for
      the RTC, and possibly also for HPET).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/hvm/vpt.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 46d3ec6..3fb0406 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -272,8 +272,9 @@ int pt_update_irq(struct vcpu *v)
      * IRR is returned and used to set eoi_exit_bitmap for virtual
      * interrupt delivery case. Otherwise return -1 to do nothing.  
      */ 
-    if ( vlapic_accept_pic_intr(v) &&
-         (&v->domain->arch.hvm_domain)->vpic[0].int_output )
+    if ( !is_lapic &&
+         platform_legacy_irq(irq) && vlapic_accept_pic_intr(v) &&
+         (&v->domain->arch.hvm_domain)->vpic[irq >> 3].int_output )
         return -1;
     else 
         return pt_irq_vector(earliest_pt, hvm_intsrc_lapic);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============5485279458442214323==
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
--===============5485279458442214323==--

From xen-changelog-bounces@lists.xen.org Fri May 03 04:23:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:23: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 1UY7X3-0003ib-9c; Fri, 03 May 2013 04:23: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 1UY7X2-0003iO-Kg
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:40 +0000
Received: from [85.158.139.211:24542] by server-9.bemta-5.messagelabs.com id
	6B/E2-14875-BCB33815; Fri, 03 May 2013 04:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1367555018!21107060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2446 invoked from network); 3 May 2013 04:23:39 -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;
	3 May 2013 04:23: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 1UY7X0-0002lJ-6B
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7X0-0004Zp-4y
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:38 +0000
Date: Fri, 03 May 2013 04:23:38 +0000
Message-Id: <E1UY7X0-0004Zp-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: fix legacy PIC check in
	pt_update_irq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5485279458442214323=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit f6b533308cd8a776bbb947f6084efc63218ad28b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 16:48:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 16:48:22 2013 +0200

    x86/HVM: fix legacy PIC check in pt_update_irq()
    
    Depending on the IRQ we need to
    - not look at the PIC at all is this is the LAPIC timer (in that case
      we're dealing with a vector number rather than an IRQ one),
    - not look at the PIC for any non-legacy interrupt,
    - look at the correct PIC for the IRQ (which will always be PIC 2 for
      the RTC, and possibly also for HPET).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/hvm/vpt.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 46d3ec6..3fb0406 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -272,8 +272,9 @@ int pt_update_irq(struct vcpu *v)
      * IRR is returned and used to set eoi_exit_bitmap for virtual
      * interrupt delivery case. Otherwise return -1 to do nothing.  
      */ 
-    if ( vlapic_accept_pic_intr(v) &&
-         (&v->domain->arch.hvm_domain)->vpic[0].int_output )
+    if ( !is_lapic &&
+         platform_legacy_irq(irq) && vlapic_accept_pic_intr(v) &&
+         (&v->domain->arch.hvm_domain)->vpic[irq >> 3].int_output )
         return -1;
     else 
         return pt_irq_vector(earliest_pt, hvm_intsrc_lapic);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============5485279458442214323==
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
--===============5485279458442214323==--

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7XP-0003mM-DW; Fri, 03 May 2013 04:24:03 +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 1UY7XO-0003m7-Uv
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:03 +0000
Received: from [193.109.254.147:28320] by server-7.bemta-14.messagelabs.com id
	7C/36-19255-2EB33815; Fri, 03 May 2013 04:24:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1367555038!3476654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29443 invoked from network); 3 May 2013 04:24:00 -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;
	3 May 2013 04:24: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 1UY7XK-0002lY-OB
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7XK-0004aY-IA
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:58 +0000
Date: Fri, 03 May 2013 04:23:58 +0000
Message-Id: <E1UY7XK-0004aY-IA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: miscellaneous mm.c 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

commit f2ddd529337792bcb61fad259da8982be570df4d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:05:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:05:05 2013 +0200

    x86: miscellaneous mm.c cleanup
    
    This simply streamlines code in a few places, where room for
    improvement was noticed during the earlier here and the patches in
    the XSA-45 series.
    
    This also drops the bogus use of the domain lock in the CR3 write
    emulation (which protected against nothing).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c            |   52 ++++++++++++++---------------------------
 xen/arch/x86/traps.c         |    4 +-
 xen/include/asm-x86/config.h |    2 -
 3 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dd89079..5123860 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2077,19 +2077,17 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
 
     /* No need for atomic update of type_info here: noone else updates it. */
     wmb();
-    if ( rc == -EAGAIN )
-    {
-        get_page_light(page);
-        page->u.inuse.type_info |= PGT_partial;
-    }
-    else if ( rc == -EINTR )
+    switch ( rc )
     {
+    case 0:
+        page->u.inuse.type_info |= PGT_validated;
+        break;
+    case -EINTR:
         ASSERT((page->u.inuse.type_info &
                 (PGT_count_mask|PGT_validated|PGT_partial)) == 1);
         page->u.inuse.type_info &= ~PGT_count_mask;
-    }
-    else if ( rc )
-    {
+        break;
+    default:
         ASSERT(rc < 0);
         MEM_LOG("Error while validating mfn %lx (pfn %lx) for type %"
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
@@ -2101,13 +2099,11 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         {
             ASSERT((page->u.inuse.type_info &
                     (PGT_count_mask | PGT_validated)) == 1);
+    case -EAGAIN:
             get_page_light(page);
             page->u.inuse.type_info |= PGT_partial;
         }
-    }
-    else
-    {
-        page->u.inuse.type_info |= PGT_validated;
+        break;
     }
 
     return rc;
@@ -2886,7 +2882,7 @@ long do_mmuext_op(
 {
     struct mmuext_op op;
     unsigned long type;
-    unsigned int i = 0, done = 0;
+    unsigned int i, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
@@ -2919,22 +2915,16 @@ long do_mmuext_op(
         perfc_incr(calls_to_mmuext_op);
 
     if ( unlikely(!guest_handle_okay(uops, count)) )
-    {
-        rc = -EFAULT;
-        goto out;
-    }
+        return -EFAULT;
 
     if ( (pg_owner = get_pg_owner(foreigndom)) == NULL )
-    {
-        rc = -ESRCH;
-        goto out;
-    }
+        return -ESRCH;
 
     rc = xsm_mmuext_op(XSM_TARGET, d, pg_owner);
     if ( rc )
     {
-        rcu_unlock_domain(pg_owner);
-        goto out;
+        put_pg_owner(pg_owner);
+        return rc;
     }
 
     for ( i = 0; i < count; i++ )
@@ -3406,7 +3396,6 @@ long do_mmuext_op(
 
     perfc_add(num_mmuext_ops, i);
 
- out:
     /* Add incremental work we have done to the @done output parameter. */
     if ( unlikely(!guest_handle_is_null(pdone)) )
     {
@@ -3462,22 +3451,17 @@ long do_mmu_update(
         perfc_incr(calls_to_mmu_update);
 
     if ( unlikely(!guest_handle_okay(ureqs, count)) )
-    {
-        rc = -EFAULT;
-        goto out;
-    }
+        return -EFAULT;
 
     if ( (pt_dom = foreigndom >> 16) != 0 )
     {
         /* Pagetables belong to a foreign domain (PFD). */
         if ( (pt_owner = rcu_lock_domain_by_id(pt_dom - 1)) == NULL )
-        {
-            rc = -EINVAL;
-            goto out;
-        }
+            return -EINVAL;
+
         if ( pt_owner == d )
             rcu_unlock_domain(pt_owner);
-        if ( (v = pt_owner->vcpu ? pt_owner->vcpu[0] : NULL) == NULL )
+        else if ( !pt_owner->vcpu || (v = pt_owner->vcpu[0]) == NULL )
         {
             rc = -EINVAL;
             goto out;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4de9313..fbbe31d 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2318,7 +2318,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case 3: {/* Write CR3 */
             unsigned long gfn;
             struct page_info *page;
-            domain_lock(v->domain);
+
             gfn = !is_pv_32on64_vcpu(v)
                 ? xen_cr3_to_pfn(*reg) : compat_cr3_to_pfn(*reg);
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
@@ -2329,7 +2329,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             }
             else
                 rc = -EINVAL;
-            domain_unlock(v->domain);
+
             switch ( rc )
             {
             case 0:
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index cf93bd5..bd8f61c 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -273,8 +273,6 @@ extern unsigned char boot_edid_info[128];
 
 #endif
 
-#define PGT_base_page_table     PGT_l4_page_table
-
 #define __HYPERVISOR_CS64 0xe008
 #define __HYPERVISOR_CS32 0xe038
 #define __HYPERVISOR_CS   __HYPERVISOR_CS64
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7XP-0003mM-DW; Fri, 03 May 2013 04:24:03 +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 1UY7XO-0003m7-Uv
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:03 +0000
Received: from [193.109.254.147:28320] by server-7.bemta-14.messagelabs.com id
	7C/36-19255-2EB33815; Fri, 03 May 2013 04:24:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1367555038!3476654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29443 invoked from network); 3 May 2013 04:24:00 -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;
	3 May 2013 04:24: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 1UY7XK-0002lY-OB
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7XK-0004aY-IA
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:58 +0000
Date: Fri, 03 May 2013 04:23:58 +0000
Message-Id: <E1UY7XK-0004aY-IA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: miscellaneous mm.c 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

commit f2ddd529337792bcb61fad259da8982be570df4d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:05:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:05:05 2013 +0200

    x86: miscellaneous mm.c cleanup
    
    This simply streamlines code in a few places, where room for
    improvement was noticed during the earlier here and the patches in
    the XSA-45 series.
    
    This also drops the bogus use of the domain lock in the CR3 write
    emulation (which protected against nothing).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c            |   52 ++++++++++++++---------------------------
 xen/arch/x86/traps.c         |    4 +-
 xen/include/asm-x86/config.h |    2 -
 3 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dd89079..5123860 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2077,19 +2077,17 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
 
     /* No need for atomic update of type_info here: noone else updates it. */
     wmb();
-    if ( rc == -EAGAIN )
-    {
-        get_page_light(page);
-        page->u.inuse.type_info |= PGT_partial;
-    }
-    else if ( rc == -EINTR )
+    switch ( rc )
     {
+    case 0:
+        page->u.inuse.type_info |= PGT_validated;
+        break;
+    case -EINTR:
         ASSERT((page->u.inuse.type_info &
                 (PGT_count_mask|PGT_validated|PGT_partial)) == 1);
         page->u.inuse.type_info &= ~PGT_count_mask;
-    }
-    else if ( rc )
-    {
+        break;
+    default:
         ASSERT(rc < 0);
         MEM_LOG("Error while validating mfn %lx (pfn %lx) for type %"
                 PRtype_info ": caf=%08lx taf=%" PRtype_info,
@@ -2101,13 +2099,11 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         {
             ASSERT((page->u.inuse.type_info &
                     (PGT_count_mask | PGT_validated)) == 1);
+    case -EAGAIN:
             get_page_light(page);
             page->u.inuse.type_info |= PGT_partial;
         }
-    }
-    else
-    {
-        page->u.inuse.type_info |= PGT_validated;
+        break;
     }
 
     return rc;
@@ -2886,7 +2882,7 @@ long do_mmuext_op(
 {
     struct mmuext_op op;
     unsigned long type;
-    unsigned int i = 0, done = 0;
+    unsigned int i, done = 0;
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
@@ -2919,22 +2915,16 @@ long do_mmuext_op(
         perfc_incr(calls_to_mmuext_op);
 
     if ( unlikely(!guest_handle_okay(uops, count)) )
-    {
-        rc = -EFAULT;
-        goto out;
-    }
+        return -EFAULT;
 
     if ( (pg_owner = get_pg_owner(foreigndom)) == NULL )
-    {
-        rc = -ESRCH;
-        goto out;
-    }
+        return -ESRCH;
 
     rc = xsm_mmuext_op(XSM_TARGET, d, pg_owner);
     if ( rc )
     {
-        rcu_unlock_domain(pg_owner);
-        goto out;
+        put_pg_owner(pg_owner);
+        return rc;
     }
 
     for ( i = 0; i < count; i++ )
@@ -3406,7 +3396,6 @@ long do_mmuext_op(
 
     perfc_add(num_mmuext_ops, i);
 
- out:
     /* Add incremental work we have done to the @done output parameter. */
     if ( unlikely(!guest_handle_is_null(pdone)) )
     {
@@ -3462,22 +3451,17 @@ long do_mmu_update(
         perfc_incr(calls_to_mmu_update);
 
     if ( unlikely(!guest_handle_okay(ureqs, count)) )
-    {
-        rc = -EFAULT;
-        goto out;
-    }
+        return -EFAULT;
 
     if ( (pt_dom = foreigndom >> 16) != 0 )
     {
         /* Pagetables belong to a foreign domain (PFD). */
         if ( (pt_owner = rcu_lock_domain_by_id(pt_dom - 1)) == NULL )
-        {
-            rc = -EINVAL;
-            goto out;
-        }
+            return -EINVAL;
+
         if ( pt_owner == d )
             rcu_unlock_domain(pt_owner);
-        if ( (v = pt_owner->vcpu ? pt_owner->vcpu[0] : NULL) == NULL )
+        else if ( !pt_owner->vcpu || (v = pt_owner->vcpu[0]) == NULL )
         {
             rc = -EINVAL;
             goto out;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4de9313..fbbe31d 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2318,7 +2318,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case 3: {/* Write CR3 */
             unsigned long gfn;
             struct page_info *page;
-            domain_lock(v->domain);
+
             gfn = !is_pv_32on64_vcpu(v)
                 ? xen_cr3_to_pfn(*reg) : compat_cr3_to_pfn(*reg);
             page = get_page_from_gfn(v->domain, gfn, NULL, P2M_ALLOC);
@@ -2329,7 +2329,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             }
             else
                 rc = -EINVAL;
-            domain_unlock(v->domain);
+
             switch ( rc )
             {
             case 0:
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index cf93bd5..bd8f61c 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -273,8 +273,6 @@ extern unsigned char boot_edid_info[128];
 
 #endif
 
-#define PGT_base_page_table     PGT_l4_page_table
-
 #define __HYPERVISOR_CS64 0xe008
 #define __HYPERVISOR_CS32 0xe038
 #define __HYPERVISOR_CS   __HYPERVISOR_CS64
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7XT-0003nD-Ge; Fri, 03 May 2013 04:24: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 1UY7XS-0003mw-5m
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:06 +0000
Received: from [85.158.139.83:34910] by server-9.bemta-5.messagelabs.com id
	B2/23-14875-5EB33815; Fri, 03 May 2013 04:24:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1367555043!29985464!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7621 invoked from network); 3 May 2013 04:24:04 -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;
	3 May 2013 04:24: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 1UY7XA-0002lS-CA
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7XA-0004aB-B4
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:48 +0000
Date: Fri, 03 May 2013 04:23:48 +0000
Message-Id: <E1UY7XA-0004aB-B4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: cleanup after making various page
	table manipulation operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b965b31a6bce8c37e67e525fae6da0e2f26d6b2e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:04:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:04:14 2013 +0200

    x86: cleanup after making various page table manipulation operations preemptible
    
    This drops the "preemptible" parameters from various functions where
    now they can't (or shouldn't, validated by assertions) be run in non-
    preemptible mode anymore, to prove that manipulations of at least L3
    and L4 page tables and page table entries are now always preemptible,
    i.e. the earlier patches actually fulfill their purpose of fixing the
    resulting security issue.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain.c    |    2 +-
 xen/arch/x86/mm.c        |   98 ++++++++++++++++++++++++---------------------
 xen/include/asm-x86/mm.h |    9 +---
 3 files changed, 55 insertions(+), 54 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0baaa95..db1e65d 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1859,7 +1859,7 @@ static int relinquish_memory(
         }
 
         if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
-            ret = put_page_and_type_preemptible(page, 1);
+            ret = put_page_and_type_preemptible(page);
         switch ( ret )
         {
         case 0:
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index aef98d5..dd89079 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -945,7 +945,7 @@ get_page_from_l2e(
 define_get_linear_pagetable(l3);
 static int
 get_page_from_l3e(
-    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -959,7 +959,7 @@ get_page_from_l3e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, preemptible);
+        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
         rc = 0;
 
@@ -969,7 +969,7 @@ get_page_from_l3e(
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
-    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -983,7 +983,7 @@ get_page_from_l4e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, preemptible);
+        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
         rc = 0;
 
@@ -1122,8 +1122,10 @@ static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)
 static int __put_page_type(struct page_info *, int preemptible);
 
 static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
+    struct page_info *pg;
+
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
@@ -1140,40 +1142,44 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
         return 0;
     }
 
+    pg = l3e_get_page(l3e);
+
     if ( unlikely(partial > 0) )
     {
-        ASSERT(preemptible >= 0);
-        return __put_page_type(l3e_get_page(l3e), preemptible);
+        ASSERT(!defer);
+        return __put_page_type(pg, 1);
     }
 
-    if ( preemptible < 0 )
+    if ( defer )
     {
-        current->arch.old_guest_table = l3e_get_page(l3e);
+        current->arch.old_guest_table = pg;
         return 0;
     }
 
-    return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+    return put_page_and_type_preemptible(pg);
 }
 
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
     if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) && 
          (l4e_get_pfn(l4e) != pfn) )
     {
+        struct page_info *pg = l4e_get_page(l4e);
+
         if ( unlikely(partial > 0) )
         {
-            ASSERT(preemptible >= 0);
-            return __put_page_type(l4e_get_page(l4e), preemptible);
+            ASSERT(!defer);
+            return __put_page_type(pg, 1);
         }
 
-        if ( preemptible < 0 )
+        if ( defer )
         {
-            current->arch.old_guest_table = l4e_get_page(l4e);
+            current->arch.old_guest_table = pg;
             return 0;
         }
 
-        return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
+        return put_page_and_type_preemptible(pg);
     }
     return 1;
 }
@@ -1307,7 +1313,7 @@ static int alloc_l2_table(struct page_info *page, unsigned long type,
     return rc > 0 ? 0 : rc;
 }
 
-static int alloc_l3_table(struct page_info *page, int preemptible)
+static int alloc_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1339,11 +1345,10 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
                 rc = get_page_and_type_from_pagenr(l3e_get_pfn(pl3e[i]),
                                                    PGT_l2_page_table |
                                                    PGT_pae_xen_l2,
-                                                   d, partial, preemptible);
+                                                   d, partial, 1);
         }
         else if ( !is_guest_l3_slot(i) ||
-                  (rc = get_page_from_l3e(pl3e[i], pfn, d,
-                                          partial, preemptible)) > 0 )
+                  (rc = get_page_from_l3e(pl3e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1403,7 +1408,7 @@ void init_guest_l4_table(l4_pgentry_t l4tab[], const struct domain *d)
         l4e_from_page(d->arch.perdomain_l3_pg, __PAGE_HYPERVISOR);
 }
 
-static int alloc_l4_table(struct page_info *page, int preemptible)
+static int alloc_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1415,8 +1420,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
           i++, partial = 0 )
     {
         if ( !is_guest_l4_slot(d, i) ||
-             (rc = get_page_from_l4e(pl4e[i], pfn, d,
-                                     partial, preemptible)) > 0 )
+             (rc = get_page_from_l4e(pl4e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1503,7 +1507,7 @@ static int free_l2_table(struct page_info *page, int preemptible)
     return err;
 }
 
-static int free_l3_table(struct page_info *page, int preemptible)
+static int free_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1516,7 +1520,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     do {
         if ( is_guest_l3_slot(i) )
         {
-            rc = put_page_from_l3e(pl3e[i], pfn, partial, preemptible);
+            rc = put_page_from_l3e(pl3e[i], pfn, partial, 0);
             if ( rc < 0 )
                 break;
             partial = 0;
@@ -1542,7 +1546,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 
-static int free_l4_table(struct page_info *page, int preemptible)
+static int free_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1552,7 +1556,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
 
     do {
         if ( is_guest_l4_slot(d, i) )
-            rc = put_page_from_l4e(pl4e[i], pfn, partial, preemptible);
+            rc = put_page_from_l4e(pl4e[i], pfn, partial, 0);
         if ( rc < 0 )
             break;
         partial = 0;
@@ -1811,7 +1815,6 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
                         l3_pgentry_t nl3e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     l3_pgentry_t ol3e;
@@ -1851,7 +1854,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l3e(nl3e, pfn, d, 0, preemptible);
+        rc = get_page_from_l3e(nl3e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -1874,7 +1877,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         if ( !create_pae_xen_mappings(d, pl3e) )
             BUG();
 
-    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
+    put_page_from_l3e(ol3e, pfn, 0, 1);
     return rc;
 }
 
@@ -1883,7 +1886,6 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
                         l4_pgentry_t nl4e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     struct domain *d = vcpu->domain;
@@ -1916,7 +1918,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l4e(nl4e, pfn, d, 0, preemptible);
+        rc = get_page_from_l4e(nl4e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -1935,7 +1937,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
+    put_page_from_l4e(ol4e, pfn, 0, 1);
     return rc;
 }
 
@@ -2055,10 +2057,12 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         rc = alloc_l2_table(page, type, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = alloc_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = alloc_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l4_table(page);
         break;
     case PGT_seg_desc_page:
         rc = alloc_segdesc_page(page);
@@ -2148,10 +2152,12 @@ int free_page_type(struct page_info *page, unsigned long type,
         rc = free_l2_table(page, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = free_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = free_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l4_table(page);
         break;
     default:
         MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
@@ -2622,7 +2628,7 @@ static int put_old_guest_table(struct vcpu *v)
     if ( !v->arch.old_guest_table )
         return 0;
 
-    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table) )
     {
     case -EINTR:
     case -EAGAIN:
@@ -2656,7 +2662,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, 1);
+            rc = put_page_and_type_preemptible(page);
     }
 
     if ( l4tab )
@@ -2677,7 +2683,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, 1);
+                rc = put_page_and_type_preemptible(page);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
@@ -2707,7 +2713,7 @@ int new_guest_cr3(unsigned long mfn)
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    gt_mfn, 0, 1, curr);
+                    gt_mfn, 0, curr);
         unmap_domain_page(pl4e);
         switch ( rc )
         {
@@ -2771,7 +2777,7 @@ int new_guest_cr3(unsigned long mfn)
         if ( paging_mode_refcounts(d) )
             put_page(page);
         else
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
                 rc = -EAGAIN;
@@ -3055,7 +3061,7 @@ long do_mmuext_op(
                 break;
             }
 
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
             case -EAGAIN:
@@ -3131,7 +3137,7 @@ long do_mmuext_op(
                 if ( paging_mode_refcounts(d) )
                     put_page(page);
                 else
-                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    switch ( rc = put_page_and_type_preemptible(page) )
                     {
                     case -EINTR:
                         rc = -EAGAIN;
@@ -3606,11 +3612,11 @@ long do_mmu_update(
                     break;
                 case PGT_l3_page_table:
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     break;
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                 break;
                 case PGT_writable_page:
                     perfc_incr(writable_mmu_updates);
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 7a92737..6b367c0 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -364,15 +364,10 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
-static inline int put_page_and_type_preemptible(struct page_info *page,
-                                                int preemptible)
+static inline int put_page_and_type_preemptible(struct page_info *page)
 {
-    int rc = 0;
+    int rc = put_page_type_preemptible(page);
 
-    if ( preemptible )
-        rc = put_page_type_preemptible(page);
-    else
-        put_page_type(page);
     if ( likely(rc == 0) )
         put_page(page);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7XT-0003nD-Ge; Fri, 03 May 2013 04:24: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 1UY7XS-0003mw-5m
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:06 +0000
Received: from [85.158.139.83:34910] by server-9.bemta-5.messagelabs.com id
	B2/23-14875-5EB33815; Fri, 03 May 2013 04:24:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1367555043!29985464!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7621 invoked from network); 3 May 2013 04:24:04 -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;
	3 May 2013 04:24: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 1UY7XA-0002lS-CA
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7XA-0004aB-B4
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:23:48 +0000
Date: Fri, 03 May 2013 04:23:48 +0000
Message-Id: <E1UY7XA-0004aB-B4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: cleanup after making various page
	table manipulation operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b965b31a6bce8c37e67e525fae6da0e2f26d6b2e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:04:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:04:14 2013 +0200

    x86: cleanup after making various page table manipulation operations preemptible
    
    This drops the "preemptible" parameters from various functions where
    now they can't (or shouldn't, validated by assertions) be run in non-
    preemptible mode anymore, to prove that manipulations of at least L3
    and L4 page tables and page table entries are now always preemptible,
    i.e. the earlier patches actually fulfill their purpose of fixing the
    resulting security issue.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain.c    |    2 +-
 xen/arch/x86/mm.c        |   98 ++++++++++++++++++++++++---------------------
 xen/include/asm-x86/mm.h |    9 +---
 3 files changed, 55 insertions(+), 54 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0baaa95..db1e65d 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1859,7 +1859,7 @@ static int relinquish_memory(
         }
 
         if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
-            ret = put_page_and_type_preemptible(page, 1);
+            ret = put_page_and_type_preemptible(page);
         switch ( ret )
         {
         case 0:
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index aef98d5..dd89079 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -945,7 +945,7 @@ get_page_from_l2e(
 define_get_linear_pagetable(l3);
 static int
 get_page_from_l3e(
-    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -959,7 +959,7 @@ get_page_from_l3e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, preemptible);
+        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
         rc = 0;
 
@@ -969,7 +969,7 @@ get_page_from_l3e(
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
-    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -983,7 +983,7 @@ get_page_from_l4e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, preemptible);
+        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
         rc = 0;
 
@@ -1122,8 +1122,10 @@ static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)
 static int __put_page_type(struct page_info *, int preemptible);
 
 static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
+    struct page_info *pg;
+
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
@@ -1140,40 +1142,44 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
         return 0;
     }
 
+    pg = l3e_get_page(l3e);
+
     if ( unlikely(partial > 0) )
     {
-        ASSERT(preemptible >= 0);
-        return __put_page_type(l3e_get_page(l3e), preemptible);
+        ASSERT(!defer);
+        return __put_page_type(pg, 1);
     }
 
-    if ( preemptible < 0 )
+    if ( defer )
     {
-        current->arch.old_guest_table = l3e_get_page(l3e);
+        current->arch.old_guest_table = pg;
         return 0;
     }
 
-    return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+    return put_page_and_type_preemptible(pg);
 }
 
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
     if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) && 
          (l4e_get_pfn(l4e) != pfn) )
     {
+        struct page_info *pg = l4e_get_page(l4e);
+
         if ( unlikely(partial > 0) )
         {
-            ASSERT(preemptible >= 0);
-            return __put_page_type(l4e_get_page(l4e), preemptible);
+            ASSERT(!defer);
+            return __put_page_type(pg, 1);
         }
 
-        if ( preemptible < 0 )
+        if ( defer )
         {
-            current->arch.old_guest_table = l4e_get_page(l4e);
+            current->arch.old_guest_table = pg;
             return 0;
         }
 
-        return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
+        return put_page_and_type_preemptible(pg);
     }
     return 1;
 }
@@ -1307,7 +1313,7 @@ static int alloc_l2_table(struct page_info *page, unsigned long type,
     return rc > 0 ? 0 : rc;
 }
 
-static int alloc_l3_table(struct page_info *page, int preemptible)
+static int alloc_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1339,11 +1345,10 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
                 rc = get_page_and_type_from_pagenr(l3e_get_pfn(pl3e[i]),
                                                    PGT_l2_page_table |
                                                    PGT_pae_xen_l2,
-                                                   d, partial, preemptible);
+                                                   d, partial, 1);
         }
         else if ( !is_guest_l3_slot(i) ||
-                  (rc = get_page_from_l3e(pl3e[i], pfn, d,
-                                          partial, preemptible)) > 0 )
+                  (rc = get_page_from_l3e(pl3e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1403,7 +1408,7 @@ void init_guest_l4_table(l4_pgentry_t l4tab[], const struct domain *d)
         l4e_from_page(d->arch.perdomain_l3_pg, __PAGE_HYPERVISOR);
 }
 
-static int alloc_l4_table(struct page_info *page, int preemptible)
+static int alloc_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1415,8 +1420,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
           i++, partial = 0 )
     {
         if ( !is_guest_l4_slot(d, i) ||
-             (rc = get_page_from_l4e(pl4e[i], pfn, d,
-                                     partial, preemptible)) > 0 )
+             (rc = get_page_from_l4e(pl4e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1503,7 +1507,7 @@ static int free_l2_table(struct page_info *page, int preemptible)
     return err;
 }
 
-static int free_l3_table(struct page_info *page, int preemptible)
+static int free_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1516,7 +1520,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     do {
         if ( is_guest_l3_slot(i) )
         {
-            rc = put_page_from_l3e(pl3e[i], pfn, partial, preemptible);
+            rc = put_page_from_l3e(pl3e[i], pfn, partial, 0);
             if ( rc < 0 )
                 break;
             partial = 0;
@@ -1542,7 +1546,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 
-static int free_l4_table(struct page_info *page, int preemptible)
+static int free_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1552,7 +1556,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
 
     do {
         if ( is_guest_l4_slot(d, i) )
-            rc = put_page_from_l4e(pl4e[i], pfn, partial, preemptible);
+            rc = put_page_from_l4e(pl4e[i], pfn, partial, 0);
         if ( rc < 0 )
             break;
         partial = 0;
@@ -1811,7 +1815,6 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
                         l3_pgentry_t nl3e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     l3_pgentry_t ol3e;
@@ -1851,7 +1854,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l3e(nl3e, pfn, d, 0, preemptible);
+        rc = get_page_from_l3e(nl3e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -1874,7 +1877,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         if ( !create_pae_xen_mappings(d, pl3e) )
             BUG();
 
-    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
+    put_page_from_l3e(ol3e, pfn, 0, 1);
     return rc;
 }
 
@@ -1883,7 +1886,6 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
                         l4_pgentry_t nl4e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     struct domain *d = vcpu->domain;
@@ -1916,7 +1918,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l4e(nl4e, pfn, d, 0, preemptible);
+        rc = get_page_from_l4e(nl4e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -1935,7 +1937,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
+    put_page_from_l4e(ol4e, pfn, 0, 1);
     return rc;
 }
 
@@ -2055,10 +2057,12 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         rc = alloc_l2_table(page, type, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = alloc_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = alloc_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l4_table(page);
         break;
     case PGT_seg_desc_page:
         rc = alloc_segdesc_page(page);
@@ -2148,10 +2152,12 @@ int free_page_type(struct page_info *page, unsigned long type,
         rc = free_l2_table(page, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = free_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = free_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l4_table(page);
         break;
     default:
         MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
@@ -2622,7 +2628,7 @@ static int put_old_guest_table(struct vcpu *v)
     if ( !v->arch.old_guest_table )
         return 0;
 
-    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table) )
     {
     case -EINTR:
     case -EAGAIN:
@@ -2656,7 +2662,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, 1);
+            rc = put_page_and_type_preemptible(page);
     }
 
     if ( l4tab )
@@ -2677,7 +2683,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, 1);
+                rc = put_page_and_type_preemptible(page);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
@@ -2707,7 +2713,7 @@ int new_guest_cr3(unsigned long mfn)
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    gt_mfn, 0, 1, curr);
+                    gt_mfn, 0, curr);
         unmap_domain_page(pl4e);
         switch ( rc )
         {
@@ -2771,7 +2777,7 @@ int new_guest_cr3(unsigned long mfn)
         if ( paging_mode_refcounts(d) )
             put_page(page);
         else
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
                 rc = -EAGAIN;
@@ -3055,7 +3061,7 @@ long do_mmuext_op(
                 break;
             }
 
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
             case -EAGAIN:
@@ -3131,7 +3137,7 @@ long do_mmuext_op(
                 if ( paging_mode_refcounts(d) )
                     put_page(page);
                 else
-                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    switch ( rc = put_page_and_type_preemptible(page) )
                     {
                     case -EINTR:
                         rc = -EAGAIN;
@@ -3606,11 +3612,11 @@ long do_mmu_update(
                     break;
                 case PGT_l3_page_table:
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     break;
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                 break;
                 case PGT_writable_page:
                     perfc_incr(writable_mmu_updates);
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 7a92737..6b367c0 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -364,15 +364,10 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
-static inline int put_page_and_type_preemptible(struct page_info *page,
-                                                int preemptible)
+static inline int put_page_and_type_preemptible(struct page_info *page)
 {
-    int rc = 0;
+    int rc = put_page_type_preemptible(page);
 
-    if ( preemptible )
-        rc = put_page_type_preemptible(page);
-    else
-        put_page_type(page);
     if ( likely(rc == 0) )
         put_page(page);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7XY-0003oP-LG; Fri, 03 May 2013 04:24:12 +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 1UY7XX-0003o5-LD
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:11 +0000
Received: from [85.158.137.99:14323] by server-14.bemta-3.messagelabs.com id
	6A/A2-20016-AEB33815; Fri, 03 May 2013 04:24:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1367555049!19125571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19160 invoked from network); 3 May 2013 04:24:10 -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;
	3 May 2013 04:24: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 1UY7XU-0002mL-V6
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7XU-0004bg-Sx
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:08 +0000
Date: Fri, 03 May 2013 04:24:08 +0000
Message-Id: <E1UY7XU-0004bg-Sx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: don't permit SVT_NO_VERIFY
	entries for known device 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

commit 63cec00679cc65ab5d5a9447a62d5202f155b78c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:08:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:08:58 2013 +0200

    VT-d: don't permit SVT_NO_VERIFY entries for known device types
    
    Only in cases where we don't know what to do we should leave the IRTE
    blank (suppressing all validation), but we should always log a warning
    in those cases (as being insecure).
    
    This is CVE-2013-1952 / XSA-49.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/intremap.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 880f15e..feaaed0 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -437,12 +437,9 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
     {
         unsigned int sq;
 
+    case DEV_TYPE_PCIe_ENDPOINT:
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
-    case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        break;
-
-    case DEV_TYPE_PCIe_ENDPOINT:
         switch ( pdev->phantom_stride )
         {
         case 1: sq = SQ_13_IGNORE_3; break;
@@ -454,6 +451,8 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
         break;
 
     case DEV_TYPE_PCI:
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    case DEV_TYPE_PCI2PCIe_BRIDGE:
         ret = find_upstream_bridge(seg, &bus, &devfn, &secbus);
         if ( ret == 0 ) /* integrated PCI device */
         {
@@ -465,10 +464,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
             if ( pdev_type(seg, bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
                 set_ire_sid(ire, SVT_VERIFY_BUS, SQ_ALL_16,
                             (bus << 8) | pdev->bus);
-            else if ( pdev_type(seg, bus, devfn) == DEV_TYPE_LEGACY_PCI_BRIDGE )
+            else
                 set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16,
                             PCI_BDF2(bus, devfn));
         }
+        else
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "d%d: no upstream bridge for %04x:%02x:%02x.%u\n",
+                    pdev->domain->domain_id,
+                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7XY-0003oP-LG; Fri, 03 May 2013 04:24:12 +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 1UY7XX-0003o5-LD
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:11 +0000
Received: from [85.158.137.99:14323] by server-14.bemta-3.messagelabs.com id
	6A/A2-20016-AEB33815; Fri, 03 May 2013 04:24:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1367555049!19125571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19160 invoked from network); 3 May 2013 04:24:10 -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;
	3 May 2013 04:24: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 1UY7XU-0002mL-V6
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7XU-0004bg-Sx
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:08 +0000
Date: Fri, 03 May 2013 04:24:08 +0000
Message-Id: <E1UY7XU-0004bg-Sx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: don't permit SVT_NO_VERIFY
	entries for known device 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

commit 63cec00679cc65ab5d5a9447a62d5202f155b78c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 2 17:08:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 2 17:08:58 2013 +0200

    VT-d: don't permit SVT_NO_VERIFY entries for known device types
    
    Only in cases where we don't know what to do we should leave the IRTE
    blank (suppressing all validation), but we should always log a warning
    in those cases (as being insecure).
    
    This is CVE-2013-1952 / XSA-49.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/intremap.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 880f15e..feaaed0 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -437,12 +437,9 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
     {
         unsigned int sq;
 
+    case DEV_TYPE_PCIe_ENDPOINT:
     case DEV_TYPE_PCIe_BRIDGE:
     case DEV_TYPE_PCIe2PCI_BRIDGE:
-    case DEV_TYPE_LEGACY_PCI_BRIDGE:
-        break;
-
-    case DEV_TYPE_PCIe_ENDPOINT:
         switch ( pdev->phantom_stride )
         {
         case 1: sq = SQ_13_IGNORE_3; break;
@@ -454,6 +451,8 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
         break;
 
     case DEV_TYPE_PCI:
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    case DEV_TYPE_PCI2PCIe_BRIDGE:
         ret = find_upstream_bridge(seg, &bus, &devfn, &secbus);
         if ( ret == 0 ) /* integrated PCI device */
         {
@@ -465,10 +464,15 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
             if ( pdev_type(seg, bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE )
                 set_ire_sid(ire, SVT_VERIFY_BUS, SQ_ALL_16,
                             (bus << 8) | pdev->bus);
-            else if ( pdev_type(seg, bus, devfn) == DEV_TYPE_LEGACY_PCI_BRIDGE )
+            else
                 set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_ALL_16,
                             PCI_BDF2(bus, devfn));
         }
+        else
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "d%d: no upstream bridge for %04x:%02x:%02x.%u\n",
+                    pdev->domain->domain_id,
+                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7Xi-0003qc-OE; Fri, 03 May 2013 04:24: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 1UY7Xh-0003q9-Sd
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:22 +0000
Received: from [85.158.137.99:14675] by server-15.bemta-3.messagelabs.com id
	49/E0-32363-5FB33815; Fri, 03 May 2013 04:24:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1367555059!20172760!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13043 invoked from network); 3 May 2013 04:24:20 -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;
	3 May 2013 04:24: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 1UY7Xf-0002mU-5i
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Xf-0004c5-2T
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:19 +0000
Date: Fri, 03 May 2013 04:24:19 +0000
Message-Id: <E1UY7Xf-0004c5-2T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Don't use tapdisk for cd-roms
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c83107132f1488fc84fe804d3c81bb7c4efa4d6a
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Thu May 2 12:03:09 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 2 16:19:04 2013 +0100

    libxl: Don't use tapdisk for cd-roms
    
    blktap does not support the insert / eject commands, and so is not
    suitable for cd-roms.
    
    This fixes the bug where libxl uses tapdisk as a cdrom back-end, causing
    subsequent eject / insert commands to fail.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    CC: Fabio Fantoni <fabio.fantoni@heliman.it>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index a826ece..a5cf446 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -178,6 +178,12 @@ static int disk_try_backend(disk_try_backend_args *a,
     case LIBXL_DISK_BACKEND_TAP:
         if (a->disk->script) goto bad_script;
 
+        if (a->disk->is_cdrom) {
+            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend tap"
+                       " unsuitable for cdroms",
+                       a->disk->vdev);
+            return 0;
+        }
         if (!libxl__blktap_enabled(a->gc)) {
             LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend tap"
                        " unsuitable because blktap not available",
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 04:24:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 04:24: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 1UY7Xi-0003qc-OE; Fri, 03 May 2013 04:24: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 1UY7Xh-0003q9-Sd
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:22 +0000
Received: from [85.158.137.99:14675] by server-15.bemta-3.messagelabs.com id
	49/E0-32363-5FB33815; Fri, 03 May 2013 04:24:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1367555059!20172760!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13043 invoked from network); 3 May 2013 04:24:20 -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;
	3 May 2013 04:24: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 1UY7Xf-0002mU-5i
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UY7Xf-0004c5-2T
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 04:24:19 +0000
Date: Fri, 03 May 2013 04:24:19 +0000
Message-Id: <E1UY7Xf-0004c5-2T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Don't use tapdisk for cd-roms
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c83107132f1488fc84fe804d3c81bb7c4efa4d6a
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Thu May 2 12:03:09 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 2 16:19:04 2013 +0100

    libxl: Don't use tapdisk for cd-roms
    
    blktap does not support the insert / eject commands, and so is not
    suitable for cd-roms.
    
    This fixes the bug where libxl uses tapdisk as a cdrom back-end, causing
    subsequent eject / insert commands to fail.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    CC: Fabio Fantoni <fabio.fantoni@heliman.it>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index a826ece..a5cf446 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -178,6 +178,12 @@ static int disk_try_backend(disk_try_backend_args *a,
     case LIBXL_DISK_BACKEND_TAP:
         if (a->disk->script) goto bad_script;
 
+        if (a->disk->is_cdrom) {
+            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend tap"
+                       " unsuitable for cdroms",
+                       a->disk->vdev);
+            return 0;
+        }
         if (!libxl__blktap_enabled(a->gc)) {
             LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend tap"
                        " unsuitable because blktap not available",
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 10:22:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 10: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 1UYD82-0006Ck-0z; Fri, 03 May 2013 10:22:14 +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 1UYD80-0006CY-EK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 10:22:12 +0000
Received: from [85.158.137.99:46626] by server-6.bemta-3.messagelabs.com id
	E3/C4-14331-3DF83815; Fri, 03 May 2013 10:22:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1367576525!16989789!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25223 invoked from network); 3 May 2013 10:22:06 -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;
	3 May 2013 10:22: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 1UYD7q-0007Bb-C5
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 10:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYD7q-0004iD-9R
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 10:22:02 +0000
Date: Fri, 03 May 2013 10:22:02 +0000
Message-Id: <E1UYD7q-0004iD-9R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Fix __prepare_to_wait() asm test
	for stack size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6248dec1b4f69d26d1687ab9b3d0e87a81f10c42
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Thu May 2 21:04:08 2013 +0100
Commit:     Keir Fraser <keir@xen.org>
CommitDate: Thu May 2 21:04:08 2013 +0100

    x86: Fix __prepare_to_wait() asm test for stack size
    
    Signed-off-by: Keir Fraser <keir@xen.org>
---
 xen/common/wait.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/wait.c b/xen/common/wait.c
index 4d6924f..3c9366c 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -145,7 +145,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
         "push %%rax; push %%rbx; push %%rdx; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
-        "1: addq $2f-1b,(%%rsp); sub %%esp,%%ecx; cmp %3,%%ecx; jbe 3f; "
+        "1: addq $2f-1b,(%%rsp); sub %%esp,%%ecx; cmp %3,%%ecx; ja 3f; "
         "mov %%rsp,%%rsi; 2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
         "pop %%r15; pop %%r14; pop %%r13; pop %%r12; "
         "pop %%r11; pop %%r10; pop %%r9; pop %%r8; "
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 10:22:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 10: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 1UYD82-0006Ck-0z; Fri, 03 May 2013 10:22:14 +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 1UYD80-0006CY-EK
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 10:22:12 +0000
Received: from [85.158.137.99:46626] by server-6.bemta-3.messagelabs.com id
	E3/C4-14331-3DF83815; Fri, 03 May 2013 10:22:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1367576525!16989789!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25223 invoked from network); 3 May 2013 10:22:06 -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;
	3 May 2013 10:22: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 1UYD7q-0007Bb-C5
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 10:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYD7q-0004iD-9R
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 10:22:02 +0000
Date: Fri, 03 May 2013 10:22:02 +0000
Message-Id: <E1UYD7q-0004iD-9R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Fix __prepare_to_wait() asm test
	for stack size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6248dec1b4f69d26d1687ab9b3d0e87a81f10c42
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Thu May 2 21:04:08 2013 +0100
Commit:     Keir Fraser <keir@xen.org>
CommitDate: Thu May 2 21:04:08 2013 +0100

    x86: Fix __prepare_to_wait() asm test for stack size
    
    Signed-off-by: Keir Fraser <keir@xen.org>
---
 xen/common/wait.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/wait.c b/xen/common/wait.c
index 4d6924f..3c9366c 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -145,7 +145,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
         "push %%rax; push %%rbx; push %%rdx; "
         "push %%rbp; push %%r8; push %%r9; push %%r10; push %%r11; "
         "push %%r12; push %%r13; push %%r14; push %%r15; call 1f; "
-        "1: addq $2f-1b,(%%rsp); sub %%esp,%%ecx; cmp %3,%%ecx; jbe 3f; "
+        "1: addq $2f-1b,(%%rsp); sub %%esp,%%ecx; cmp %3,%%ecx; ja 3f; "
         "mov %%rsp,%%rsi; 2: rep movsb; mov %%rsp,%%rsi; 3: pop %%rax; "
         "pop %%r15; pop %%r14; pop %%r13; pop %%r12; "
         "pop %%r11; pop %%r10; pop %%r9; pop %%r8; "
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 16:55:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 16: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 1UYJGK-0002og-23; Fri, 03 May 2013 16:55:12 +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 1UYJGI-0002ob-U6
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 16:55:11 +0000
Received: from [85.158.139.83:10053] by server-12.bemta-5.messagelabs.com id
	34/1E-16465-EEBE3815; Fri, 03 May 2013 16:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1367600108!30105797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23514 invoked from network); 3 May 2013 16:55:09 -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;
	3 May 2013 16:55: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 1UYJGD-0003U6-9S
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 16:55:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYJGB-0005hg-Cz
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 16:55:03 +0000
Date: Fri, 03 May 2013 16:55:03 +0000
Message-Id: <E1UYJGB-0005hg-Cz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] apic/iommu: Correct grammar in error
	message and clarify its meaning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1c61028eabb4e2bb37f7541915c1bee4abab94e8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 3 09:33:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 3 09:33:49 2013 +0200

    apic/iommu: Correct grammar in error message and clarify its meaning
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/apic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index d251aa1..b28f5ed 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -970,8 +970,8 @@ void __init x2apic_bsp_setup(void)
             panic("Interrupt remapping could not be enabled while "
                   "x2APIC is already enabled by BIOS!\n");
 
-        printk("Would not enable x2APIC due to interrupt remapping "
-               "cannot be enabled.\n");
+        printk(XENLOG_ERR
+               "Failed to enable Interrupt Remapping: Will not enable x2APIC.\n");
         goto restore_out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 16:55:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 16: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 1UYJGK-0002og-23; Fri, 03 May 2013 16:55:12 +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 1UYJGI-0002ob-U6
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 16:55:11 +0000
Received: from [85.158.139.83:10053] by server-12.bemta-5.messagelabs.com id
	34/1E-16465-EEBE3815; Fri, 03 May 2013 16:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1367600108!30105797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23514 invoked from network); 3 May 2013 16:55:09 -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;
	3 May 2013 16:55: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 1UYJGD-0003U6-9S
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 16:55:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYJGB-0005hg-Cz
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 16:55:03 +0000
Date: Fri, 03 May 2013 16:55:03 +0000
Message-Id: <E1UYJGB-0005hg-Cz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] apic/iommu: Correct grammar in error
	message and clarify its meaning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1c61028eabb4e2bb37f7541915c1bee4abab94e8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 3 09:33:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 3 09:33:49 2013 +0200

    apic/iommu: Correct grammar in error message and clarify its meaning
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/apic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index d251aa1..b28f5ed 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -970,8 +970,8 @@ void __init x2apic_bsp_setup(void)
             panic("Interrupt remapping could not be enabled while "
                   "x2APIC is already enabled by BIOS!\n");
 
-        printk("Would not enable x2APIC due to interrupt remapping "
-               "cannot be enabled.\n");
+        printk(XENLOG_ERR
+               "Failed to enable Interrupt Remapping: Will not enable x2APIC.\n");
         goto restore_out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 03 18:00:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 18:00: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 1UYKHB-0005TL-M3; Fri, 03 May 2013 18:00:09 +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 1UYKH9-0005T8-Cm
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 18:00:07 +0000
Received: from [85.158.139.83:10427] by server-13.bemta-5.messagelabs.com id
	F6/90-08040-62BF3815; Fri, 03 May 2013 18:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1367604003!28002920!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10817 invoked from network); 3 May 2013 18:00:04 -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;
	3 May 2013 18:00: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 1UYKH5-0004Fc-7M
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 18:00:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYKH4-0007E2-Jt
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 18:00:02 +0000
Date: Fri, 03 May 2013 18:00:02 +0000
Message-Id: <E1UYKH4-0007E2-Jt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: cleanup after making various
	page table manipulation operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dd6967ce98556d1a5f04c513a6cdde52d7d988ee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 3 09:42:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 3 09:42:15 2013 +0200

    x86: cleanup after making various page table manipulation operations preemptible
    
    This drops the "preemptible" parameters from various functions where
    now they can't (or shouldn't, validated by assertions) be run in non-
    preemptible mode anymore, to prove that manipulations of at least L3
    and L4 page tables and page table entries are now always preemptible,
    i.e. the earlier patches actually fulfill their purpose of fixing the
    resulting security issue.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b965b31a6bce8c37e67e525fae6da0e2f26d6b2e
    master date: 2013-05-02 17:04:14 +0200
---
 xen/arch/x86/domain.c    |    2 +-
 xen/arch/x86/mm.c        |  102 ++++++++++++++++++++++++---------------------
 xen/include/asm-x86/mm.h |    9 +---
 3 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index b97ac6d..f76b362 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1986,7 +1986,7 @@ static int relinquish_memory(
         }
 
         if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
-            ret = put_page_and_type_preemptible(page, 1);
+            ret = put_page_and_type_preemptible(page);
         switch ( ret )
         {
         case 0:
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 055f307..a9e3618 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1027,7 +1027,7 @@ get_page_from_l2e(
 define_get_linear_pagetable(l3);
 static int
 get_page_from_l3e(
-    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -1041,7 +1041,7 @@ get_page_from_l3e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, preemptible);
+        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
         rc = 0;
 
@@ -1052,7 +1052,7 @@ get_page_from_l3e(
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
-    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -1066,7 +1066,7 @@ get_page_from_l4e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, preemptible);
+        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
         rc = 0;
 
@@ -1220,8 +1220,10 @@ static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)
 static int __put_page_type(struct page_info *, int preemptible);
 
 static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
+    struct page_info *pg;
+
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
@@ -1240,41 +1242,45 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
     }
 #endif
 
+    pg = l3e_get_page(l3e);
+
     if ( unlikely(partial > 0) )
     {
-        ASSERT(preemptible >= 0);
-        return __put_page_type(l3e_get_page(l3e), preemptible);
+        ASSERT(!defer);
+        return __put_page_type(pg, 1);
     }
 
-    if ( preemptible < 0 )
+    if ( defer )
     {
-        current->arch.old_guest_table = l3e_get_page(l3e);
+        current->arch.old_guest_table = pg;
         return 0;
     }
 
-    return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+    return put_page_and_type_preemptible(pg);
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
     if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) && 
          (l4e_get_pfn(l4e) != pfn) )
     {
+        struct page_info *pg = l4e_get_page(l4e);
+
         if ( unlikely(partial > 0) )
         {
-            ASSERT(preemptible >= 0);
-            return __put_page_type(l4e_get_page(l4e), preemptible);
+            ASSERT(!defer);
+            return __put_page_type(pg, 1);
         }
 
-        if ( preemptible < 0 )
+        if ( defer )
         {
-            current->arch.old_guest_table = l4e_get_page(l4e);
+            current->arch.old_guest_table = pg;
             return 0;
         }
 
-        return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
+        return put_page_and_type_preemptible(pg);
     }
     return 1;
 }
@@ -1492,7 +1498,7 @@ static int alloc_l2_table(struct page_info *page, unsigned long type,
     return rc > 0 ? 0 : rc;
 }
 
-static int alloc_l3_table(struct page_info *page, int preemptible)
+static int alloc_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1539,11 +1545,10 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
                 rc = get_page_and_type_from_pagenr(l3e_get_pfn(pl3e[i]),
                                                    PGT_l2_page_table |
                                                    PGT_pae_xen_l2,
-                                                   d, partial, preemptible);
+                                                   d, partial, 1);
         }
         else if ( !is_guest_l3_slot(i) ||
-                  (rc = get_page_from_l3e(pl3e[i], pfn, d,
-                                          partial, preemptible)) > 0 )
+                  (rc = get_page_from_l3e(pl3e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1587,7 +1592,7 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int alloc_l4_table(struct page_info *page, int preemptible)
+static int alloc_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1599,8 +1604,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
           i++, partial = 0 )
     {
         if ( !is_guest_l4_slot(d, i) ||
-             (rc = get_page_from_l4e(pl4e[i], pfn, d,
-                                     partial, preemptible)) > 0 )
+             (rc = get_page_from_l4e(pl4e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1645,7 +1649,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define alloc_l4_table(page, preemptible) (-EINVAL)
+#define alloc_l4_table(page) (-EINVAL)
 #endif
 
 
@@ -1697,7 +1701,7 @@ static int free_l2_table(struct page_info *page, int preemptible)
     return err;
 }
 
-static int free_l3_table(struct page_info *page, int preemptible)
+static int free_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1710,7 +1714,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     do {
         if ( is_guest_l3_slot(i) )
         {
-            rc = put_page_from_l3e(pl3e[i], pfn, partial, preemptible);
+            rc = put_page_from_l3e(pl3e[i], pfn, partial, 0);
             if ( rc < 0 )
                 break;
             partial = 0;
@@ -1737,7 +1741,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int free_l4_table(struct page_info *page, int preemptible)
+static int free_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1747,7 +1751,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
 
     do {
         if ( is_guest_l4_slot(d, i) )
-            rc = put_page_from_l4e(pl4e[i], pfn, partial, preemptible);
+            rc = put_page_from_l4e(pl4e[i], pfn, partial, 0);
         if ( rc < 0 )
             break;
         partial = 0;
@@ -1767,7 +1771,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define free_l4_table(page, preemptible) (-EINVAL)
+#define free_l4_table(page) (-EINVAL)
 #endif
 
 int page_lock(struct page_info *page)
@@ -2006,7 +2010,6 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
                         l3_pgentry_t nl3e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     l3_pgentry_t ol3e;
@@ -2046,7 +2049,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l3e(nl3e, pfn, d, 0, preemptible);
+        rc = get_page_from_l3e(nl3e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -2073,7 +2076,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
+    put_page_from_l3e(ol3e, pfn, 0, 1);
     return rc;
 }
 
@@ -2084,7 +2087,6 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
                         l4_pgentry_t nl4e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     struct domain *d = vcpu->domain;
@@ -2117,7 +2119,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l4e(nl4e, pfn, d, 0, preemptible);
+        rc = get_page_from_l4e(nl4e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -2136,7 +2138,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
+    put_page_from_l4e(ol4e, pfn, 0, 1);
     return rc;
 }
 
@@ -2258,10 +2260,12 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         rc = alloc_l2_table(page, type, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = alloc_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = alloc_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l4_table(page);
         break;
     case PGT_seg_desc_page:
         rc = alloc_segdesc_page(page);
@@ -2355,10 +2359,12 @@ int free_page_type(struct page_info *page, unsigned long type,
         if ( !(type & PGT_partial) )
             page->nr_validated_ptes = L3_PAGETABLE_ENTRIES;
 #endif
-        rc = free_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = free_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l4_table(page);
         break;
     default:
         MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
@@ -2849,7 +2855,7 @@ static int put_old_guest_table(struct vcpu *v)
     if ( !v->arch.old_guest_table )
         return 0;
 
-    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table) )
     {
     case -EINTR:
     case -EAGAIN:
@@ -2881,7 +2887,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, 1);
+            rc = put_page_and_type_preemptible(page);
     }
 
 #ifdef __x86_64__
@@ -2907,7 +2913,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, 1);
+                rc = put_page_and_type_preemptible(page);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
@@ -2936,7 +2942,7 @@ int new_guest_cr3(unsigned long mfn)
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+                    pagetable_get_pfn(curr->arch.guest_table), 0, curr);
         switch ( rc )
         {
         case 0:
@@ -2999,7 +3005,7 @@ int new_guest_cr3(unsigned long mfn)
         if ( paging_mode_refcounts(d) )
             put_page(page);
         else
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
                 rc = -EAGAIN;
@@ -3310,7 +3316,7 @@ long do_mmuext_op(
                 break;
             }
 
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
             case -EAGAIN:
@@ -3388,7 +3394,7 @@ long do_mmuext_op(
                 if ( paging_mode_refcounts(d) )
                     put_page(page);
                 else
-                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    switch ( rc = put_page_and_type_preemptible(page) )
                     {
                     case -EINTR:
                         rc = -EAGAIN;
@@ -3865,12 +3871,12 @@ long do_mmu_update(
                     break;
                 case PGT_l3_page_table:
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     break;
 #if CONFIG_PAGING_LEVELS >= 4
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                 break;
 #endif
                 case PGT_writable_page:
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 82cdde6..372e3ac 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -384,15 +384,10 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
-static inline int put_page_and_type_preemptible(struct page_info *page,
-                                                int preemptible)
+static inline int put_page_and_type_preemptible(struct page_info *page)
 {
-    int rc = 0;
+    int rc = put_page_type_preemptible(page);
 
-    if ( preemptible )
-        rc = put_page_type_preemptible(page);
-    else
-        put_page_type(page);
     if ( likely(rc == 0) )
         put_page(page);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 18:00:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 18:00: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 1UYKHB-0005TL-M3; Fri, 03 May 2013 18:00:09 +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 1UYKH9-0005T8-Cm
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 18:00:07 +0000
Received: from [85.158.139.83:10427] by server-13.bemta-5.messagelabs.com id
	F6/90-08040-62BF3815; Fri, 03 May 2013 18:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1367604003!28002920!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10817 invoked from network); 3 May 2013 18:00:04 -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;
	3 May 2013 18:00: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 1UYKH5-0004Fc-7M
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 18:00:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYKH4-0007E2-Jt
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 18:00:02 +0000
Date: Fri, 03 May 2013 18:00:02 +0000
Message-Id: <E1UYKH4-0007E2-Jt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: cleanup after making various
	page table manipulation operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dd6967ce98556d1a5f04c513a6cdde52d7d988ee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 3 09:42:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 3 09:42:15 2013 +0200

    x86: cleanup after making various page table manipulation operations preemptible
    
    This drops the "preemptible" parameters from various functions where
    now they can't (or shouldn't, validated by assertions) be run in non-
    preemptible mode anymore, to prove that manipulations of at least L3
    and L4 page tables and page table entries are now always preemptible,
    i.e. the earlier patches actually fulfill their purpose of fixing the
    resulting security issue.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b965b31a6bce8c37e67e525fae6da0e2f26d6b2e
    master date: 2013-05-02 17:04:14 +0200
---
 xen/arch/x86/domain.c    |    2 +-
 xen/arch/x86/mm.c        |  102 ++++++++++++++++++++++++---------------------
 xen/include/asm-x86/mm.h |    9 +---
 3 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index b97ac6d..f76b362 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1986,7 +1986,7 @@ static int relinquish_memory(
         }
 
         if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
-            ret = put_page_and_type_preemptible(page, 1);
+            ret = put_page_and_type_preemptible(page);
         switch ( ret )
         {
         case 0:
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 055f307..a9e3618 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1027,7 +1027,7 @@ get_page_from_l2e(
 define_get_linear_pagetable(l3);
 static int
 get_page_from_l3e(
-    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -1041,7 +1041,7 @@ get_page_from_l3e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, preemptible);
+        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
         rc = 0;
 
@@ -1052,7 +1052,7 @@ get_page_from_l3e(
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
-    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -1066,7 +1066,7 @@ get_page_from_l4e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, preemptible);
+        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
         rc = 0;
 
@@ -1220,8 +1220,10 @@ static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)
 static int __put_page_type(struct page_info *, int preemptible);
 
 static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
+    struct page_info *pg;
+
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
@@ -1240,41 +1242,45 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
     }
 #endif
 
+    pg = l3e_get_page(l3e);
+
     if ( unlikely(partial > 0) )
     {
-        ASSERT(preemptible >= 0);
-        return __put_page_type(l3e_get_page(l3e), preemptible);
+        ASSERT(!defer);
+        return __put_page_type(pg, 1);
     }
 
-    if ( preemptible < 0 )
+    if ( defer )
     {
-        current->arch.old_guest_table = l3e_get_page(l3e);
+        current->arch.old_guest_table = pg;
         return 0;
     }
 
-    return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+    return put_page_and_type_preemptible(pg);
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
     if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) && 
          (l4e_get_pfn(l4e) != pfn) )
     {
+        struct page_info *pg = l4e_get_page(l4e);
+
         if ( unlikely(partial > 0) )
         {
-            ASSERT(preemptible >= 0);
-            return __put_page_type(l4e_get_page(l4e), preemptible);
+            ASSERT(!defer);
+            return __put_page_type(pg, 1);
         }
 
-        if ( preemptible < 0 )
+        if ( defer )
         {
-            current->arch.old_guest_table = l4e_get_page(l4e);
+            current->arch.old_guest_table = pg;
             return 0;
         }
 
-        return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
+        return put_page_and_type_preemptible(pg);
     }
     return 1;
 }
@@ -1492,7 +1498,7 @@ static int alloc_l2_table(struct page_info *page, unsigned long type,
     return rc > 0 ? 0 : rc;
 }
 
-static int alloc_l3_table(struct page_info *page, int preemptible)
+static int alloc_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1539,11 +1545,10 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
                 rc = get_page_and_type_from_pagenr(l3e_get_pfn(pl3e[i]),
                                                    PGT_l2_page_table |
                                                    PGT_pae_xen_l2,
-                                                   d, partial, preemptible);
+                                                   d, partial, 1);
         }
         else if ( !is_guest_l3_slot(i) ||
-                  (rc = get_page_from_l3e(pl3e[i], pfn, d,
-                                          partial, preemptible)) > 0 )
+                  (rc = get_page_from_l3e(pl3e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1587,7 +1592,7 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int alloc_l4_table(struct page_info *page, int preemptible)
+static int alloc_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1599,8 +1604,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
           i++, partial = 0 )
     {
         if ( !is_guest_l4_slot(d, i) ||
-             (rc = get_page_from_l4e(pl4e[i], pfn, d,
-                                     partial, preemptible)) > 0 )
+             (rc = get_page_from_l4e(pl4e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1645,7 +1649,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define alloc_l4_table(page, preemptible) (-EINVAL)
+#define alloc_l4_table(page) (-EINVAL)
 #endif
 
 
@@ -1697,7 +1701,7 @@ static int free_l2_table(struct page_info *page, int preemptible)
     return err;
 }
 
-static int free_l3_table(struct page_info *page, int preemptible)
+static int free_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1710,7 +1714,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     do {
         if ( is_guest_l3_slot(i) )
         {
-            rc = put_page_from_l3e(pl3e[i], pfn, partial, preemptible);
+            rc = put_page_from_l3e(pl3e[i], pfn, partial, 0);
             if ( rc < 0 )
                 break;
             partial = 0;
@@ -1737,7 +1741,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int free_l4_table(struct page_info *page, int preemptible)
+static int free_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1747,7 +1751,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
 
     do {
         if ( is_guest_l4_slot(d, i) )
-            rc = put_page_from_l4e(pl4e[i], pfn, partial, preemptible);
+            rc = put_page_from_l4e(pl4e[i], pfn, partial, 0);
         if ( rc < 0 )
             break;
         partial = 0;
@@ -1767,7 +1771,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define free_l4_table(page, preemptible) (-EINVAL)
+#define free_l4_table(page) (-EINVAL)
 #endif
 
 int page_lock(struct page_info *page)
@@ -2006,7 +2010,6 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
                         l3_pgentry_t nl3e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     l3_pgentry_t ol3e;
@@ -2046,7 +2049,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l3e(nl3e, pfn, d, 0, preemptible);
+        rc = get_page_from_l3e(nl3e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -2073,7 +2076,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
+    put_page_from_l3e(ol3e, pfn, 0, 1);
     return rc;
 }
 
@@ -2084,7 +2087,6 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
                         l4_pgentry_t nl4e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     struct domain *d = vcpu->domain;
@@ -2117,7 +2119,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l4e(nl4e, pfn, d, 0, preemptible);
+        rc = get_page_from_l4e(nl4e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -2136,7 +2138,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
+    put_page_from_l4e(ol4e, pfn, 0, 1);
     return rc;
 }
 
@@ -2258,10 +2260,12 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         rc = alloc_l2_table(page, type, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = alloc_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = alloc_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l4_table(page);
         break;
     case PGT_seg_desc_page:
         rc = alloc_segdesc_page(page);
@@ -2355,10 +2359,12 @@ int free_page_type(struct page_info *page, unsigned long type,
         if ( !(type & PGT_partial) )
             page->nr_validated_ptes = L3_PAGETABLE_ENTRIES;
 #endif
-        rc = free_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = free_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l4_table(page);
         break;
     default:
         MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
@@ -2849,7 +2855,7 @@ static int put_old_guest_table(struct vcpu *v)
     if ( !v->arch.old_guest_table )
         return 0;
 
-    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table) )
     {
     case -EINTR:
     case -EAGAIN:
@@ -2881,7 +2887,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, 1);
+            rc = put_page_and_type_preemptible(page);
     }
 
 #ifdef __x86_64__
@@ -2907,7 +2913,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, 1);
+                rc = put_page_and_type_preemptible(page);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
@@ -2936,7 +2942,7 @@ int new_guest_cr3(unsigned long mfn)
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+                    pagetable_get_pfn(curr->arch.guest_table), 0, curr);
         switch ( rc )
         {
         case 0:
@@ -2999,7 +3005,7 @@ int new_guest_cr3(unsigned long mfn)
         if ( paging_mode_refcounts(d) )
             put_page(page);
         else
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
                 rc = -EAGAIN;
@@ -3310,7 +3316,7 @@ long do_mmuext_op(
                 break;
             }
 
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
             case -EAGAIN:
@@ -3388,7 +3394,7 @@ long do_mmuext_op(
                 if ( paging_mode_refcounts(d) )
                     put_page(page);
                 else
-                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    switch ( rc = put_page_and_type_preemptible(page) )
                     {
                     case -EINTR:
                         rc = -EAGAIN;
@@ -3865,12 +3871,12 @@ long do_mmu_update(
                     break;
                 case PGT_l3_page_table:
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     break;
 #if CONFIG_PAGING_LEVELS >= 4
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                 break;
 #endif
                 case PGT_writable_page:
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 82cdde6..372e3ac 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -384,15 +384,10 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
-static inline int put_page_and_type_preemptible(struct page_info *page,
-                                                int preemptible)
+static inline int put_page_and_type_preemptible(struct page_info *page)
 {
-    int rc = 0;
+    int rc = put_page_type_preemptible(page);
 
-    if ( preemptible )
-        rc = put_page_type_preemptible(page);
-    else
-        put_page_type(page);
     if ( likely(rc == 0) )
         put_page(page);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 03 21:33:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 21: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 1UYNbM-0002fd-8H; Fri, 03 May 2013 21:33:12 +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 1UYNbK-0002fX-Dy
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 21:33:10 +0000
Received: from [193.109.254.147:16175] by server-9.bemta-14.messagelabs.com id
	97/11-04223-51D24815; Fri, 03 May 2013 21:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1367616786!8811357!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31769 invoked from network); 3 May 2013 21:33:07 -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;
	3 May 2013 21:33: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 1UYNbF-0006ct-4O
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 21:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYNbC-0003dT-Fj
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 21:33:02 +0000
Date: Fri, 03 May 2013 21:33:02 +0000
Message-Id: <E1UYNbC-0003dT-Fj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: cleanup after making various
	page table manipulation operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0e4b458420eadd464f08c732fbe1aeed5382e5a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 3 09:46:54 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 3 09:46:54 2013 +0200

    x86: cleanup after making various page table manipulation operations preemptible
    
    This drops the "preemptible" parameters from various functions where
    now they can't (or shouldn't, validated by assertions) be run in non-
    preemptible mode anymore, to prove that manipulations of at least L3
    and L4 page tables and page table entries are now always preemptible,
    i.e. the earlier patches actually fulfill their purpose of fixing the
    resulting security issue.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b965b31a6bce8c37e67e525fae6da0e2f26d6b2e
    master date: 2013-05-02 17:04:14 +0200
---
 xen/arch/x86/domain.c    |    2 +-
 xen/arch/x86/mm.c        |  102 ++++++++++++++++++++++++---------------------
 xen/include/asm-x86/mm.h |    9 +---
 3 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 9a34488..7b544b2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1855,7 +1855,7 @@ static int relinquish_memory(
         }
 
         if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
-            ret = put_page_and_type_preemptible(page, 1);
+            ret = put_page_and_type_preemptible(page);
         switch ( ret )
         {
         case 0:
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b7fc4cb..29b0ede 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -969,7 +969,7 @@ get_page_from_l2e(
 define_get_linear_pagetable(l3);
 static int
 get_page_from_l3e(
-    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -983,7 +983,7 @@ get_page_from_l3e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, preemptible);
+        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
         rc = 0;
 
@@ -994,7 +994,7 @@ get_page_from_l3e(
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
-    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -1008,7 +1008,7 @@ get_page_from_l4e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, preemptible);
+        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
         rc = 0;
 
@@ -1162,8 +1162,10 @@ static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)
 static int __put_page_type(struct page_info *, int preemptible);
 
 static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
+    struct page_info *pg;
+
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
@@ -1182,41 +1184,45 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
     }
 #endif
 
+    pg = l3e_get_page(l3e);
+
     if ( unlikely(partial > 0) )
     {
-        ASSERT(preemptible >= 0);
-        return __put_page_type(l3e_get_page(l3e), preemptible);
+        ASSERT(!defer);
+        return __put_page_type(pg, 1);
     }
 
-    if ( preemptible < 0 )
+    if ( defer )
     {
-        current->arch.old_guest_table = l3e_get_page(l3e);
+        current->arch.old_guest_table = pg;
         return 0;
     }
 
-    return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+    return put_page_and_type_preemptible(pg);
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
     if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) && 
          (l4e_get_pfn(l4e) != pfn) )
     {
+        struct page_info *pg = l4e_get_page(l4e);
+
         if ( unlikely(partial > 0) )
         {
-            ASSERT(preemptible >= 0);
-            return __put_page_type(l4e_get_page(l4e), preemptible);
+            ASSERT(!defer);
+            return __put_page_type(pg, 1);
         }
 
-        if ( preemptible < 0 )
+        if ( defer )
         {
-            current->arch.old_guest_table = l4e_get_page(l4e);
+            current->arch.old_guest_table = pg;
             return 0;
         }
 
-        return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
+        return put_page_and_type_preemptible(pg);
     }
     return 1;
 }
@@ -1429,7 +1435,7 @@ static int alloc_l2_table(struct page_info *page, unsigned long type,
     return rc > 0 ? 0 : rc;
 }
 
-static int alloc_l3_table(struct page_info *page, int preemptible)
+static int alloc_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1476,11 +1482,10 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
                 rc = get_page_and_type_from_pagenr(l3e_get_pfn(pl3e[i]),
                                                    PGT_l2_page_table |
                                                    PGT_pae_xen_l2,
-                                                   d, partial, preemptible);
+                                                   d, partial, 1);
         }
         else if ( !is_guest_l3_slot(i) ||
-                  (rc = get_page_from_l3e(pl3e[i], pfn, d,
-                                          partial, preemptible)) > 0 )
+                  (rc = get_page_from_l3e(pl3e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1524,7 +1529,7 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int alloc_l4_table(struct page_info *page, int preemptible)
+static int alloc_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1536,8 +1541,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
           i++, partial = 0 )
     {
         if ( !is_guest_l4_slot(d, i) ||
-             (rc = get_page_from_l4e(pl4e[i], pfn, d,
-                                     partial, preemptible)) > 0 )
+             (rc = get_page_from_l4e(pl4e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1582,7 +1586,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define alloc_l4_table(page, preemptible) (-EINVAL)
+#define alloc_l4_table(page) (-EINVAL)
 #endif
 
 
@@ -1634,7 +1638,7 @@ static int free_l2_table(struct page_info *page, int preemptible)
     return err;
 }
 
-static int free_l3_table(struct page_info *page, int preemptible)
+static int free_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1647,7 +1651,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     do {
         if ( is_guest_l3_slot(i) )
         {
-            rc = put_page_from_l3e(pl3e[i], pfn, partial, preemptible);
+            rc = put_page_from_l3e(pl3e[i], pfn, partial, 0);
             if ( rc < 0 )
                 break;
             partial = 0;
@@ -1674,7 +1678,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int free_l4_table(struct page_info *page, int preemptible)
+static int free_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1684,7 +1688,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
 
     do {
         if ( is_guest_l4_slot(d, i) )
-            rc = put_page_from_l4e(pl4e[i], pfn, partial, preemptible);
+            rc = put_page_from_l4e(pl4e[i], pfn, partial, 0);
         if ( rc < 0 )
             break;
         partial = 0;
@@ -1704,7 +1708,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define free_l4_table(page, preemptible) (-EINVAL)
+#define free_l4_table(page) (-EINVAL)
 #endif
 
 static int page_lock(struct page_info *page)
@@ -1925,7 +1929,6 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
                         l3_pgentry_t nl3e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     l3_pgentry_t ol3e;
@@ -1965,7 +1968,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l3e(nl3e, pfn, d, 0, preemptible);
+        rc = get_page_from_l3e(nl3e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -1992,7 +1995,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
+    put_page_from_l3e(ol3e, pfn, 0, 1);
     return rc;
 }
 
@@ -2003,7 +2006,6 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
                         l4_pgentry_t nl4e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     struct domain *d = vcpu->domain;
@@ -2036,7 +2038,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l4e(nl4e, pfn, d, 0, preemptible);
+        rc = get_page_from_l4e(nl4e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -2055,7 +2057,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
+    put_page_from_l4e(ol4e, pfn, 0, 1);
     return rc;
 }
 
@@ -2177,10 +2179,12 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         rc = alloc_l2_table(page, type, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = alloc_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = alloc_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l4_table(page);
         break;
     case PGT_seg_desc_page:
         rc = alloc_segdesc_page(page);
@@ -2274,10 +2278,12 @@ int free_page_type(struct page_info *page, unsigned long type,
         if ( !(type & PGT_partial) )
             page->nr_validated_ptes = L3_PAGETABLE_ENTRIES;
 #endif
-        rc = free_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = free_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l4_table(page);
         break;
     default:
         MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
@@ -2766,7 +2772,7 @@ static int put_old_guest_table(struct vcpu *v)
     if ( !v->arch.old_guest_table )
         return 0;
 
-    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table) )
     {
     case -EINTR:
     case -EAGAIN:
@@ -2798,7 +2804,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, 1);
+            rc = put_page_and_type_preemptible(page);
     }
 
 #ifdef __x86_64__
@@ -2824,7 +2830,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, 1);
+                rc = put_page_and_type_preemptible(page);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
@@ -2853,7 +2859,7 @@ int new_guest_cr3(unsigned long mfn)
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+                    pagetable_get_pfn(curr->arch.guest_table), 0, curr);
         switch ( rc )
         {
         case 0:
@@ -2916,7 +2922,7 @@ int new_guest_cr3(unsigned long mfn)
         if ( paging_mode_refcounts(d) )
             put_page(page);
         else
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
                 rc = -EAGAIN;
@@ -3225,7 +3231,7 @@ long do_mmuext_op(
                 break;
             }
 
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
             case -EAGAIN:
@@ -3291,7 +3297,7 @@ long do_mmuext_op(
                 if ( paging_mode_refcounts(d) )
                     put_page(page);
                 else
-                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    switch ( rc = put_page_and_type_preemptible(page) )
                     {
                     case -EINTR:
                         rc = -EAGAIN;
@@ -3817,7 +3823,7 @@ long do_mmu_update(
                     }
 
                     rc = mod_l3_entry(va, l3e, mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     okay = !rc;
                 }
                 break;
@@ -3849,7 +3855,7 @@ long do_mmu_update(
                     }
 
                     rc = mod_l4_entry(va, l4e, mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     okay = !rc;
                 }
                 break;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index ecf93c2..df7161a 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -347,15 +347,10 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
-static inline int put_page_and_type_preemptible(struct page_info *page,
-                                                int preemptible)
+static inline int put_page_and_type_preemptible(struct page_info *page)
 {
-    int rc = 0;
+    int rc = put_page_type_preemptible(page);
 
-    if ( preemptible )
-        rc = put_page_type_preemptible(page);
-    else
-        put_page_type(page);
     if ( likely(rc == 0) )
         put_page(page);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 03 21:33:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 May 2013 21: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 1UYNbM-0002fd-8H; Fri, 03 May 2013 21:33:12 +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 1UYNbK-0002fX-Dy
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 21:33:10 +0000
Received: from [193.109.254.147:16175] by server-9.bemta-14.messagelabs.com id
	97/11-04223-51D24815; Fri, 03 May 2013 21:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1367616786!8811357!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31769 invoked from network); 3 May 2013 21:33:07 -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;
	3 May 2013 21:33: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 1UYNbF-0006ct-4O
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 21:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UYNbC-0003dT-Fj
	for xen-changelog@lists.xensource.com; Fri, 03 May 2013 21:33:02 +0000
Date: Fri, 03 May 2013 21:33:02 +0000
Message-Id: <E1UYNbC-0003dT-Fj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: cleanup after making various
	page table manipulation operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0e4b458420eadd464f08c732fbe1aeed5382e5a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 3 09:46:54 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 3 09:46:54 2013 +0200

    x86: cleanup after making various page table manipulation operations preemptible
    
    This drops the "preemptible" parameters from various functions where
    now they can't (or shouldn't, validated by assertions) be run in non-
    preemptible mode anymore, to prove that manipulations of at least L3
    and L4 page tables and page table entries are now always preemptible,
    i.e. the earlier patches actually fulfill their purpose of fixing the
    resulting security issue.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: b965b31a6bce8c37e67e525fae6da0e2f26d6b2e
    master date: 2013-05-02 17:04:14 +0200
---
 xen/arch/x86/domain.c    |    2 +-
 xen/arch/x86/mm.c        |  102 ++++++++++++++++++++++++---------------------
 xen/include/asm-x86/mm.h |    9 +---
 3 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 9a34488..7b544b2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1855,7 +1855,7 @@ static int relinquish_memory(
         }
 
         if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
-            ret = put_page_and_type_preemptible(page, 1);
+            ret = put_page_and_type_preemptible(page);
         switch ( ret )
         {
         case 0:
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b7fc4cb..29b0ede 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -969,7 +969,7 @@ get_page_from_l2e(
 define_get_linear_pagetable(l3);
 static int
 get_page_from_l3e(
-    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -983,7 +983,7 @@ get_page_from_l3e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, preemptible);
+        l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
         rc = 0;
 
@@ -994,7 +994,7 @@ get_page_from_l3e(
 define_get_linear_pagetable(l4);
 static int
 get_page_from_l4e(
-    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial, int preemptible)
+    l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial)
 {
     int rc;
 
@@ -1008,7 +1008,7 @@ get_page_from_l4e(
     }
 
     rc = get_page_and_type_from_pagenr(
-        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, preemptible);
+        l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, 1);
     if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
         rc = 0;
 
@@ -1162,8 +1162,10 @@ static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)
 static int __put_page_type(struct page_info *, int preemptible);
 
 static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
+    struct page_info *pg;
+
     if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
         return 1;
 
@@ -1182,41 +1184,45 @@ static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
     }
 #endif
 
+    pg = l3e_get_page(l3e);
+
     if ( unlikely(partial > 0) )
     {
-        ASSERT(preemptible >= 0);
-        return __put_page_type(l3e_get_page(l3e), preemptible);
+        ASSERT(!defer);
+        return __put_page_type(pg, 1);
     }
 
-    if ( preemptible < 0 )
+    if ( defer )
     {
-        current->arch.old_guest_table = l3e_get_page(l3e);
+        current->arch.old_guest_table = pg;
         return 0;
     }
 
-    return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+    return put_page_and_type_preemptible(pg);
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
 static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
-                             int partial, int preemptible)
+                             int partial, bool_t defer)
 {
     if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) && 
          (l4e_get_pfn(l4e) != pfn) )
     {
+        struct page_info *pg = l4e_get_page(l4e);
+
         if ( unlikely(partial > 0) )
         {
-            ASSERT(preemptible >= 0);
-            return __put_page_type(l4e_get_page(l4e), preemptible);
+            ASSERT(!defer);
+            return __put_page_type(pg, 1);
         }
 
-        if ( preemptible < 0 )
+        if ( defer )
         {
-            current->arch.old_guest_table = l4e_get_page(l4e);
+            current->arch.old_guest_table = pg;
             return 0;
         }
 
-        return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
+        return put_page_and_type_preemptible(pg);
     }
     return 1;
 }
@@ -1429,7 +1435,7 @@ static int alloc_l2_table(struct page_info *page, unsigned long type,
     return rc > 0 ? 0 : rc;
 }
 
-static int alloc_l3_table(struct page_info *page, int preemptible)
+static int alloc_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1476,11 +1482,10 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
                 rc = get_page_and_type_from_pagenr(l3e_get_pfn(pl3e[i]),
                                                    PGT_l2_page_table |
                                                    PGT_pae_xen_l2,
-                                                   d, partial, preemptible);
+                                                   d, partial, 1);
         }
         else if ( !is_guest_l3_slot(i) ||
-                  (rc = get_page_from_l3e(pl3e[i], pfn, d,
-                                          partial, preemptible)) > 0 )
+                  (rc = get_page_from_l3e(pl3e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1524,7 +1529,7 @@ static int alloc_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int alloc_l4_table(struct page_info *page, int preemptible)
+static int alloc_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long  pfn = page_to_mfn(page);
@@ -1536,8 +1541,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
           i++, partial = 0 )
     {
         if ( !is_guest_l4_slot(d, i) ||
-             (rc = get_page_from_l4e(pl4e[i], pfn, d,
-                                     partial, preemptible)) > 0 )
+             (rc = get_page_from_l4e(pl4e[i], pfn, d, partial)) > 0 )
             continue;
 
         if ( rc == -EAGAIN )
@@ -1582,7 +1586,7 @@ static int alloc_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define alloc_l4_table(page, preemptible) (-EINVAL)
+#define alloc_l4_table(page) (-EINVAL)
 #endif
 
 
@@ -1634,7 +1638,7 @@ static int free_l2_table(struct page_info *page, int preemptible)
     return err;
 }
 
-static int free_l3_table(struct page_info *page, int preemptible)
+static int free_l3_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1647,7 +1651,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
     do {
         if ( is_guest_l3_slot(i) )
         {
-            rc = put_page_from_l3e(pl3e[i], pfn, partial, preemptible);
+            rc = put_page_from_l3e(pl3e[i], pfn, partial, 0);
             if ( rc < 0 )
                 break;
             partial = 0;
@@ -1674,7 +1678,7 @@ static int free_l3_table(struct page_info *page, int preemptible)
 }
 
 #if CONFIG_PAGING_LEVELS >= 4
-static int free_l4_table(struct page_info *page, int preemptible)
+static int free_l4_table(struct page_info *page)
 {
     struct domain *d = page_get_owner(page);
     unsigned long pfn = page_to_mfn(page);
@@ -1684,7 +1688,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
 
     do {
         if ( is_guest_l4_slot(d, i) )
-            rc = put_page_from_l4e(pl4e[i], pfn, partial, preemptible);
+            rc = put_page_from_l4e(pl4e[i], pfn, partial, 0);
         if ( rc < 0 )
             break;
         partial = 0;
@@ -1704,7 +1708,7 @@ static int free_l4_table(struct page_info *page, int preemptible)
     return rc > 0 ? 0 : rc;
 }
 #else
-#define free_l4_table(page, preemptible) (-EINVAL)
+#define free_l4_table(page) (-EINVAL)
 #endif
 
 static int page_lock(struct page_info *page)
@@ -1925,7 +1929,6 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
                         l3_pgentry_t nl3e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     l3_pgentry_t ol3e;
@@ -1965,7 +1968,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l3e(nl3e, pfn, d, 0, preemptible);
+        rc = get_page_from_l3e(nl3e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -1992,7 +1995,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
         pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
     }
 
-    put_page_from_l3e(ol3e, pfn, 0, -preemptible);
+    put_page_from_l3e(ol3e, pfn, 0, 1);
     return rc;
 }
 
@@ -2003,7 +2006,6 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
                         l4_pgentry_t nl4e, 
                         unsigned long pfn,
                         int preserve_ad,
-                        int preemptible,
                         struct vcpu *vcpu)
 {
     struct domain *d = vcpu->domain;
@@ -2036,7 +2038,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
             return rc ? 0 : -EFAULT;
         }
 
-        rc = get_page_from_l4e(nl4e, pfn, d, 0, preemptible);
+        rc = get_page_from_l4e(nl4e, pfn, d, 0);
         if ( unlikely(rc < 0) )
             return rc;
         rc = 0;
@@ -2055,7 +2057,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
         return -EFAULT;
     }
 
-    put_page_from_l4e(ol4e, pfn, 0, -preemptible);
+    put_page_from_l4e(ol4e, pfn, 0, 1);
     return rc;
 }
 
@@ -2177,10 +2179,12 @@ static int alloc_page_type(struct page_info *page, unsigned long type,
         rc = alloc_l2_table(page, type, preemptible);
         break;
     case PGT_l3_page_table:
-        rc = alloc_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = alloc_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = alloc_l4_table(page);
         break;
     case PGT_seg_desc_page:
         rc = alloc_segdesc_page(page);
@@ -2274,10 +2278,12 @@ int free_page_type(struct page_info *page, unsigned long type,
         if ( !(type & PGT_partial) )
             page->nr_validated_ptes = L3_PAGETABLE_ENTRIES;
 #endif
-        rc = free_l3_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l3_table(page);
         break;
     case PGT_l4_page_table:
-        rc = free_l4_table(page, preemptible);
+        ASSERT(preemptible);
+        rc = free_l4_table(page);
         break;
     default:
         MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
@@ -2766,7 +2772,7 @@ static int put_old_guest_table(struct vcpu *v)
     if ( !v->arch.old_guest_table )
         return 0;
 
-    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table, 1) )
+    switch ( rc = put_page_and_type_preemptible(v->arch.old_guest_table) )
     {
     case -EINTR:
     case -EAGAIN:
@@ -2798,7 +2804,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
         if ( paging_mode_refcounts(v->domain) )
             put_page(page);
         else
-            rc = put_page_and_type_preemptible(page, 1);
+            rc = put_page_and_type_preemptible(page);
     }
 
 #ifdef __x86_64__
@@ -2824,7 +2830,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
             if ( paging_mode_refcounts(v->domain) )
                 put_page(page);
             else
-                rc = put_page_and_type_preemptible(page, 1);
+                rc = put_page_and_type_preemptible(page);
         }
         if ( !rc )
             v->arch.guest_table_user = pagetable_null();
@@ -2853,7 +2859,7 @@ int new_guest_cr3(unsigned long mfn)
                     l4e_from_pfn(
                         mfn,
                         (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
-                    pagetable_get_pfn(curr->arch.guest_table), 0, 1, curr);
+                    pagetable_get_pfn(curr->arch.guest_table), 0, curr);
         switch ( rc )
         {
         case 0:
@@ -2916,7 +2922,7 @@ int new_guest_cr3(unsigned long mfn)
         if ( paging_mode_refcounts(d) )
             put_page(page);
         else
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
                 rc = -EAGAIN;
@@ -3225,7 +3231,7 @@ long do_mmuext_op(
                 break;
             }
 
-            switch ( rc = put_page_and_type_preemptible(page, 1) )
+            switch ( rc = put_page_and_type_preemptible(page) )
             {
             case -EINTR:
             case -EAGAIN:
@@ -3291,7 +3297,7 @@ long do_mmuext_op(
                 if ( paging_mode_refcounts(d) )
                     put_page(page);
                 else
-                    switch ( rc = put_page_and_type_preemptible(page, 1) )
+                    switch ( rc = put_page_and_type_preemptible(page) )
                     {
                     case -EINTR:
                         rc = -EAGAIN;
@@ -3817,7 +3823,7 @@ long do_mmu_update(
                     }
 
                     rc = mod_l3_entry(va, l3e, mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     okay = !rc;
                 }
                 break;
@@ -3849,7 +3855,7 @@ long do_mmu_update(
                     }
 
                     rc = mod_l4_entry(va, l4e, mfn,
-                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, 1, v);
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     okay = !rc;
                 }
                 break;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index ecf93c2..df7161a 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -347,15 +347,10 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
-static inline int put_page_and_type_preemptible(struct page_info *page,
-                                                int preemptible)
+static inline int put_page_and_type_preemptible(struct page_info *page)
 {
-    int rc = 0;
+    int rc = put_page_type_preemptible(page);
 
-    if ( preemptible )
-        rc = put_page_type_preemptible(page);
-    else
-        put_page_type(page);
     if ( likely(rc == 0) )
         put_page(page);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Tue May 07 19:33:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 May 2013 19: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 1UZndQ-0000Xi-0Z; Tue, 07 May 2013 19:33:12 +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 1UZndO-0000Xd-70
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:10 +0000
Received: from [85.158.137.99:11885] by server-11.bemta-3.messagelabs.com id
	5F/BD-05438-3F659815; Tue, 07 May 2013 19:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1367955185!12635044!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17542 invoked from network); 7 May 2013 19:33:06 -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;
	7 May 2013 19:33: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 1UZndI-00085n-E4
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZndH-00086B-G0
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:03 +0000
Date: Tue, 07 May 2013 19:33:03 +0000
Message-Id: <E1UZndH-00086B-G0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Bump some library sonames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dac66a5b2db37a40c7eb4b9d25ee8095106906c0
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 7 11:39:10 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 7 13:37:56 2013 +0100

    tools: Bump some library sonames
    
    libxc (libxenctrl, libxenguest):
       New claim_enabled field in struct xc_dom_image;
       New nr_outstanding_pages field in struct xc_dominfo;
       New fields in struct xc_hvm_build_args (xenguest.h).
    
    libxl:
       new fields in dominfo domain_build_info device_vfb device_vkb
         device_disk etc. etc. etc.
       libxlu #includes libxl headers so needs to inherit its new soname
       Use Xen version for new sonames since we don't in fact guarantee
       ABI (as opposed to API) stability across releases.
    
    xenstore (libxenstore):
       New flag XS_UNWATCH_FILTER, so bump minor version only.
    
    This was the result of reviewing the output from:
      git-checkout staging
      cd tools
      git-diff RELEASE-4.2.2 `find -name \*.h`
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/Makefile    |    2 +-
 tools/libxl/Makefile    |    6 +++---
 tools/xenstore/Makefile |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 640e333..b200123 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-MAJOR    = 4.2
+MAJOR    = 4.3
 MINOR    = 0
 
 CTRL_SRCS-y       :=
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 2984051..cf214bb 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -5,11 +5,11 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-MAJOR = 2.0
+MAJOR = 4.3
 MINOR = 0
 
-XLUMAJOR = 1.0
-XLUMINOR = 1
+XLUMAJOR = 4.3
+XLUMINOR = 0
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 1bb6e58..262f401 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -2,7 +2,7 @@ XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 MAJOR = 3.0
-MINOR = 2
+MINOR = 3
 
 CFLAGS += -Werror
 CFLAGS += -I.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 07 19:33:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 May 2013 19: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 1UZndQ-0000Xi-0Z; Tue, 07 May 2013 19:33:12 +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 1UZndO-0000Xd-70
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:10 +0000
Received: from [85.158.137.99:11885] by server-11.bemta-3.messagelabs.com id
	5F/BD-05438-3F659815; Tue, 07 May 2013 19:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1367955185!12635044!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17542 invoked from network); 7 May 2013 19:33:06 -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;
	7 May 2013 19:33: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 1UZndI-00085n-E4
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZndH-00086B-G0
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:03 +0000
Date: Tue, 07 May 2013 19:33:03 +0000
Message-Id: <E1UZndH-00086B-G0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Bump some library sonames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dac66a5b2db37a40c7eb4b9d25ee8095106906c0
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 7 11:39:10 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 7 13:37:56 2013 +0100

    tools: Bump some library sonames
    
    libxc (libxenctrl, libxenguest):
       New claim_enabled field in struct xc_dom_image;
       New nr_outstanding_pages field in struct xc_dominfo;
       New fields in struct xc_hvm_build_args (xenguest.h).
    
    libxl:
       new fields in dominfo domain_build_info device_vfb device_vkb
         device_disk etc. etc. etc.
       libxlu #includes libxl headers so needs to inherit its new soname
       Use Xen version for new sonames since we don't in fact guarantee
       ABI (as opposed to API) stability across releases.
    
    xenstore (libxenstore):
       New flag XS_UNWATCH_FILTER, so bump minor version only.
    
    This was the result of reviewing the output from:
      git-checkout staging
      cd tools
      git-diff RELEASE-4.2.2 `find -name \*.h`
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/Makefile    |    2 +-
 tools/libxl/Makefile    |    6 +++---
 tools/xenstore/Makefile |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 640e333..b200123 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-MAJOR    = 4.2
+MAJOR    = 4.3
 MINOR    = 0
 
 CTRL_SRCS-y       :=
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 2984051..cf214bb 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -5,11 +5,11 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-MAJOR = 2.0
+MAJOR = 4.3
 MINOR = 0
 
-XLUMAJOR = 1.0
-XLUMINOR = 1
+XLUMAJOR = 4.3
+XLUMINOR = 0
 
 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 1bb6e58..262f401 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -2,7 +2,7 @@ XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 MAJOR = 3.0
-MINOR = 2
+MINOR = 3
 
 CFLAGS += -Werror
 CFLAGS += -I.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 07 19:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 May 2013 19: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 1UZndZ-0000Y7-3g; Tue, 07 May 2013 19:33:21 +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 1UZndX-0000Xw-Ao
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:19 +0000
Received: from [85.158.143.99:11077] by server-1.bemta-4.messagelabs.com id
	4F/62-06122-EF659815; Tue, 07 May 2013 19:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1367955197!25027060!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1361 invoked from network); 7 May 2013 19:33:18 -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;
	7 May 2013 19:33: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 1UZndU-00085q-S3
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZndT-00086Z-Nx
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:15 +0000
Date: Tue, 07 May 2013 19:33:15 +0000
Message-Id: <E1UZndT-00086Z-Nx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: update version number
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0ddfb3c5fbfd65d453461a58f65aa1b3172d0136
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 7 13:41:15 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 7 13:41:15 2013 +0100

    README: update version number
    
    Updated the figlet version number to "Xen 4.3-rc".  Also remove the
    paragraph touting the benefits of Xen 4.2.  At some point we should
    replace it with a paragraph touting the benefits of Xen 4.3.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 README |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 6c4742f..595d0c8 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 #################################
- __  __            _  _    ____  
- \ \/ /___ _ __   | || |  |___ \ 
-  \  // _ \ '_ \  | || |_   __) |
-  /  \  __/ | | | |__   _| / __/ 
- /_/\_\___|_| |_|    |_|(_)_____|
+__  __            _  _    _____                
+\ \/ /___ _ __   | || |  |___ /       _ __ ___ 
+ \  // _ \ '_ \  | || |_   |_ \ _____| '__/ __|
+ /  \  __/ | | | |__   _| ___) |_____| | | (__ 
+/_/\_\___|_| |_|    |_|(_)____/      |_|  \___|
                              
 #################################
 
@@ -19,11 +19,6 @@ is freely-distributable Open Source software, released under the GNU
 GPL. Since its initial public release, Xen has grown a large
 development community, spearheaded by xen.org (http://www.xen.org).
 
-The 4.2 release offers excellent performance, hardware support and
-enterprise-grade features such as x86_32-PAE, x86_64, SMP guests and
-live relocation of VMs. Ports to Linux, NetBSD, FreeBSD and Solaris
-are available from the community.
-
 This file contains some quick-start instructions to install Xen on
 your system. For more information see http:/www.xen.org/ and
 http://wiki.xen.org/
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 07 19:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 May 2013 19: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 1UZndZ-0000Y7-3g; Tue, 07 May 2013 19:33:21 +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 1UZndX-0000Xw-Ao
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:19 +0000
Received: from [85.158.143.99:11077] by server-1.bemta-4.messagelabs.com id
	4F/62-06122-EF659815; Tue, 07 May 2013 19:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1367955197!25027060!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1361 invoked from network); 7 May 2013 19:33:18 -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;
	7 May 2013 19:33: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 1UZndU-00085q-S3
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZndT-00086Z-Nx
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:15 +0000
Date: Tue, 07 May 2013 19:33:15 +0000
Message-Id: <E1UZndT-00086Z-Nx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: update version number
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0ddfb3c5fbfd65d453461a58f65aa1b3172d0136
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 7 13:41:15 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 7 13:41:15 2013 +0100

    README: update version number
    
    Updated the figlet version number to "Xen 4.3-rc".  Also remove the
    paragraph touting the benefits of Xen 4.2.  At some point we should
    replace it with a paragraph touting the benefits of Xen 4.3.
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 README |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 6c4742f..595d0c8 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 #################################
- __  __            _  _    ____  
- \ \/ /___ _ __   | || |  |___ \ 
-  \  // _ \ '_ \  | || |_   __) |
-  /  \  __/ | | | |__   _| / __/ 
- /_/\_\___|_| |_|    |_|(_)_____|
+__  __            _  _    _____                
+\ \/ /___ _ __   | || |  |___ /       _ __ ___ 
+ \  // _ \ '_ \  | || |_   |_ \ _____| '__/ __|
+ /  \  __/ | | | |__   _| ___) |_____| | | (__ 
+/_/\_\___|_| |_|    |_|(_)____/      |_|  \___|
                              
 #################################
 
@@ -19,11 +19,6 @@ is freely-distributable Open Source software, released under the GNU
 GPL. Since its initial public release, Xen has grown a large
 development community, spearheaded by xen.org (http://www.xen.org).
 
-The 4.2 release offers excellent performance, hardware support and
-enterprise-grade features such as x86_32-PAE, x86_64, SMP guests and
-live relocation of VMs. Ports to Linux, NetBSD, FreeBSD and Solaris
-are available from the community.
-
 This file contains some quick-start instructions to install Xen on
 your system. For more information see http:/www.xen.org/ and
 http://wiki.xen.org/
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 07 19:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 May 2013 19: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 1UZndj-0000ZP-6b; Tue, 07 May 2013 19:33: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 1UZndh-0000ZB-T2
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:30 +0000
Received: from [85.158.137.99:40690] by server-12.bemta-3.messagelabs.com id
	90/1C-17342-90759815; Tue, 07 May 2013 19:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1367955207!15467956!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23599 invoked from network); 7 May 2013 19:33:28 -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;
	7 May 2013 19:33: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 1UZndf-00085t-2M
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZndf-00086w-06
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:27 +0000
Date: Tue, 07 May 2013 19:33:27 +0000
Message-Id: <E1UZndf-00086w-06@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: update QEMU_TAG and
	QEMU_UPSTREAM_REVISION for 4.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 4de97462d34f7b74c748ab67600fe2386131b778
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 7 14:01:11 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 7 14:01:11 2013 +0100

    Config.mk: update QEMU_TAG and QEMU_UPSTREAM_REVISION for 4.3.0-rc1
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index b1f12ec..f270b36 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,7 +212,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.0-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.1
 # Wed Aug 29 21:27:37 2012 -0400
 # Make iasl option check work with older versions of iasl.
@@ -224,7 +224,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= b86eb6bb95e67d22185967657c97fb6a2f131198
+QEMU_TAG ?= xen-4.3.0-rc1
 # Fri Mar 15 18:25:15 2013 +0000
 # xen: Disable use of O_DIRECT by default as it results in crashes.
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 07 19:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 May 2013 19: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 1UZndj-0000ZP-6b; Tue, 07 May 2013 19:33: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 1UZndh-0000ZB-T2
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:30 +0000
Received: from [85.158.137.99:40690] by server-12.bemta-3.messagelabs.com id
	90/1C-17342-90759815; Tue, 07 May 2013 19:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1367955207!15467956!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23599 invoked from network); 7 May 2013 19:33:28 -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;
	7 May 2013 19:33: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 1UZndf-00085t-2M
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZndf-00086w-06
	for xen-changelog@lists.xensource.com; Tue, 07 May 2013 19:33:27 +0000
Date: Tue, 07 May 2013 19:33:27 +0000
Message-Id: <E1UZndf-00086w-06@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: update QEMU_TAG and
	QEMU_UPSTREAM_REVISION for 4.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 4de97462d34f7b74c748ab67600fe2386131b778
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 7 14:01:11 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 7 14:01:11 2013 +0100

    Config.mk: update QEMU_TAG and QEMU_UPSTREAM_REVISION for 4.3.0-rc1
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index b1f12ec..f270b36 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,7 +212,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.0-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.1
 # Wed Aug 29 21:27:37 2012 -0400
 # Make iasl option check work with older versions of iasl.
@@ -224,7 +224,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= b86eb6bb95e67d22185967657c97fb6a2f131198
+QEMU_TAG ?= xen-4.3.0-rc1
 # Fri Mar 15 18:25:15 2013 +0000
 # xen: Disable use of O_DIRECT by default as it results in crashes.
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01: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 1UZtFj-0002dS-Vj; Wed, 08 May 2013 01:33: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 1UZtFj-0002dH-1I
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:07 +0000
Received: from [85.158.139.83:36653] by server-9.bemta-5.messagelabs.com id
	9E/4D-14875-25BA9815; Wed, 08 May 2013 01:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1367976784!24377718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24626 invoked from network); 8 May 2013 01:33:05 -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;
	8 May 2013 01:33: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 1UZtFg-0001yA-Fx
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtFf-0000i0-19
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:03 +0000
Date: Wed, 08 May 2013 01:33:03 +0000
Message-Id: <E1UZtFf-0000i0-19@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] AMD IOMMU: fill msi_desc fields
	required by commit fe017c59
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 da3ef0f81250b5a680001610028ff35ee94741bc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 7 16:23:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:23:31 2013 +0200

    AMD IOMMU: fill msi_desc fields required by commit fe017c59
    
    Since the AMD IOMMU code relies on the x86 generic MSI code, it also
    needs to be updated to match "x86/MSI: cleanup to prepare for multi-
    vector MSI".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_init.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 73d9ce4..abb94ec 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -775,9 +775,16 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
     control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
                               PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
                               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;
+    iommu->msi.msi.nvec = 1;
+    if ( is_mask_bit_support(control) )
+    {
+        iommu->msi.msi_attrib.maskbit = 1;
+        iommu->msi.msi.mpos = msi_mask_bits_reg(iommu->msi.msi_attrib.pos,
+                                                is_64bit_address(control));
+        desc->handler = &iommu_maskable_msi_type;
+    }
+    else
+        desc->handler = &iommu_msi_type;
     ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01: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 1UZtFj-0002dS-Vj; Wed, 08 May 2013 01:33: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 1UZtFj-0002dH-1I
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:07 +0000
Received: from [85.158.139.83:36653] by server-9.bemta-5.messagelabs.com id
	9E/4D-14875-25BA9815; Wed, 08 May 2013 01:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1367976784!24377718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24626 invoked from network); 8 May 2013 01:33:05 -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;
	8 May 2013 01:33: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 1UZtFg-0001yA-Fx
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtFf-0000i0-19
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:03 +0000
Date: Wed, 08 May 2013 01:33:03 +0000
Message-Id: <E1UZtFf-0000i0-19@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] AMD IOMMU: fill msi_desc fields
	required by commit fe017c59
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 da3ef0f81250b5a680001610028ff35ee94741bc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 7 16:23:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:23:31 2013 +0200

    AMD IOMMU: fill msi_desc fields required by commit fe017c59
    
    Since the AMD IOMMU code relies on the x86 generic MSI code, it also
    needs to be updated to match "x86/MSI: cleanup to prepare for multi-
    vector MSI".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_init.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 73d9ce4..abb94ec 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -775,9 +775,16 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
     control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
                               PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
                               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;
+    iommu->msi.msi.nvec = 1;
+    if ( is_mask_bit_support(control) )
+    {
+        iommu->msi.msi_attrib.maskbit = 1;
+        iommu->msi.msi.mpos = msi_mask_bits_reg(iommu->msi.msi_attrib.pos,
+                                                is_64bit_address(control));
+        desc->handler = &iommu_maskable_msi_type;
+    }
+    else
+        desc->handler = &iommu_msi_type;
     ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01: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 1UZtFx-0002e9-34; Wed, 08 May 2013 01:33:21 +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 1UZtFw-0002e1-67
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:20 +0000
Received: from [85.158.143.99:37945] by server-2.bemta-4.messagelabs.com id
	BF/E3-27124-F5BA9815; Wed, 08 May 2013 01:33:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367976796!28506111!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8776 invoked from network); 8 May 2013 01:33:17 -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;
	8 May 2013 01:33: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 1UZtFs-0001yD-Iz
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtFq-0000iS-N3
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:14 +0000
Date: Wed, 08 May 2013 01:33:14 +0000
Message-Id: <E1UZtFq-0000iS-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: handle paged gfn in
	wrmsr_hypervisor_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

commit 013e34f5a61725012467f17650597d351fc0ca99
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue May 7 16:41:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:41:24 2013 +0200

    x86: handle paged gfn in wrmsr_hypervisor_regs
    
    If xenpaging is started very early for a guest the gfn for the hypercall
    page may be paged-out already. This leads to a guest crash:
    
    ...
    (XEN) HVM10: Allocated Xen hypercall page at 169ff000
    (XEN) traps.c:654:d10 Bad GMFN 169ff (MFN 3e900000000) to MSR 40000000
    (XEN) HVM10: Detected Xen v4.3
    (XEN) io.c:201:d10 MMIO emulation failed @ 0008:c2c2c2c2: 18 7c 55 6d 03 83 ff ff 10 7c
    (XEN) hvm.c:1253:d10 Triple fault on VCPU0 - invoking HVM shutdown action 1.
    (XEN) HVM11: HVM Loader
    ...
    
    Update return codes of wrmsr_hypervisor_regs, update callers to deal
    with the new return codes:
     0: not handled
     1: handled
     -EAGAIN: retry
    
    Currently wrmsr_hypervisor_regs will not return the following error, it
    will be added in a separate patch:
     -EINVAL: error during handling
    
    Also update the gdprintk to handle a page value of NULL to avoid
    printing a bogus MFN value. Update also computing of MSR value in
    gdprintk, the idx was always zero.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/svm/svm.c |   16 +++++++++++++---
 xen/arch/x86/hvm/vmx/vmx.c |   11 ++++++++++-
 xen/arch/x86/traps.c       |   14 +++++++++++---
 3 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index bc1fe62..cdc176d 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1569,7 +1569,7 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 
 static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
 {
-    int ret;
+    int ret, result = X86EMUL_OKAY;
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     int sync = 0;
@@ -1682,14 +1682,24 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         if ( wrmsr_viridian_regs(msr, msr_content) )
             break;
 
-        wrmsr_hypervisor_regs(msr, msr_content);
+        switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+        {
+        case -EAGAIN:
+            result = X86EMUL_RETRY;
+            break;
+        case 0:
+        case 1:
+            break;
+        default:
+            goto gpf;
+        }
         break;
     }
 
     if ( sync )
         svm_vmload(vmcb);
 
-    return X86EMUL_OKAY;
+    return result;
 
  gpf:
     hvm_inject_hw_exception(TRAP_gp_fault, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 51187a9..d0de44a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2088,7 +2088,16 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
             case HNDL_unhandled:
                 if ( (vmx_write_guest_msr(msr, msr_content) != 0) &&
                      !is_last_branch_msr(msr) )
-                    wrmsr_hypervisor_regs(msr, msr_content);
+                    switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+                    {
+                    case -EAGAIN:
+                        return X86EMUL_RETRY;
+                    case 0:
+                    case 1:
+                        break;
+                    default:
+                        goto gp_fault;
+                    }
                 break;
             case HNDL_exception_raised:
                 return X86EMUL_EXCEPTION;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index fbbe31d..f630f83 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -634,6 +634,7 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
         unsigned long gmfn = val >> 12;
         unsigned int idx  = val & 0xfff;
         struct page_info *page;
+        p2m_type_t t;
 
         if ( idx > 0 )
         {
@@ -643,15 +644,22 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
             return 0;
         }
 
-        page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
+        page = get_page_from_gfn(d, gmfn, &t, P2M_ALLOC);
 
         if ( !page || !get_page_type(page, PGT_writable_page) )
         {
             if ( page )
                 put_page(page);
+
+            if ( p2m_is_paging(t) )
+            {
+                p2m_mem_paging_populate(d, gmfn);
+                return -EAGAIN;
+            }
+
             gdprintk(XENLOG_WARNING,
                      "Bad GMFN %lx (MFN %lx) to MSR %08x\n",
-                     gmfn, page_to_mfn(page), base + idx);
+                     gmfn, page ? page_to_mfn(page) : -1UL, base);
             return 0;
         }
 
@@ -2490,7 +2498,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                 goto fail;
             break;
         default:
-            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) )
+            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) == 1 )
                 break;
 
             rc = vmce_wrmsr(regs->ecx, msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01: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 1UZtFx-0002e9-34; Wed, 08 May 2013 01:33:21 +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 1UZtFw-0002e1-67
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:20 +0000
Received: from [85.158.143.99:37945] by server-2.bemta-4.messagelabs.com id
	BF/E3-27124-F5BA9815; Wed, 08 May 2013 01:33:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367976796!28506111!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8776 invoked from network); 8 May 2013 01:33:17 -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;
	8 May 2013 01:33: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 1UZtFs-0001yD-Iz
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtFq-0000iS-N3
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:14 +0000
Date: Wed, 08 May 2013 01:33:14 +0000
Message-Id: <E1UZtFq-0000iS-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: handle paged gfn in
	wrmsr_hypervisor_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

commit 013e34f5a61725012467f17650597d351fc0ca99
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue May 7 16:41:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:41:24 2013 +0200

    x86: handle paged gfn in wrmsr_hypervisor_regs
    
    If xenpaging is started very early for a guest the gfn for the hypercall
    page may be paged-out already. This leads to a guest crash:
    
    ...
    (XEN) HVM10: Allocated Xen hypercall page at 169ff000
    (XEN) traps.c:654:d10 Bad GMFN 169ff (MFN 3e900000000) to MSR 40000000
    (XEN) HVM10: Detected Xen v4.3
    (XEN) io.c:201:d10 MMIO emulation failed @ 0008:c2c2c2c2: 18 7c 55 6d 03 83 ff ff 10 7c
    (XEN) hvm.c:1253:d10 Triple fault on VCPU0 - invoking HVM shutdown action 1.
    (XEN) HVM11: HVM Loader
    ...
    
    Update return codes of wrmsr_hypervisor_regs, update callers to deal
    with the new return codes:
     0: not handled
     1: handled
     -EAGAIN: retry
    
    Currently wrmsr_hypervisor_regs will not return the following error, it
    will be added in a separate patch:
     -EINVAL: error during handling
    
    Also update the gdprintk to handle a page value of NULL to avoid
    printing a bogus MFN value. Update also computing of MSR value in
    gdprintk, the idx was always zero.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/svm/svm.c |   16 +++++++++++++---
 xen/arch/x86/hvm/vmx/vmx.c |   11 ++++++++++-
 xen/arch/x86/traps.c       |   14 +++++++++++---
 3 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index bc1fe62..cdc176d 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1569,7 +1569,7 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 
 static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
 {
-    int ret;
+    int ret, result = X86EMUL_OKAY;
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     int sync = 0;
@@ -1682,14 +1682,24 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         if ( wrmsr_viridian_regs(msr, msr_content) )
             break;
 
-        wrmsr_hypervisor_regs(msr, msr_content);
+        switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+        {
+        case -EAGAIN:
+            result = X86EMUL_RETRY;
+            break;
+        case 0:
+        case 1:
+            break;
+        default:
+            goto gpf;
+        }
         break;
     }
 
     if ( sync )
         svm_vmload(vmcb);
 
-    return X86EMUL_OKAY;
+    return result;
 
  gpf:
     hvm_inject_hw_exception(TRAP_gp_fault, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 51187a9..d0de44a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2088,7 +2088,16 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
             case HNDL_unhandled:
                 if ( (vmx_write_guest_msr(msr, msr_content) != 0) &&
                      !is_last_branch_msr(msr) )
-                    wrmsr_hypervisor_regs(msr, msr_content);
+                    switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+                    {
+                    case -EAGAIN:
+                        return X86EMUL_RETRY;
+                    case 0:
+                    case 1:
+                        break;
+                    default:
+                        goto gp_fault;
+                    }
                 break;
             case HNDL_exception_raised:
                 return X86EMUL_EXCEPTION;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index fbbe31d..f630f83 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -634,6 +634,7 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
         unsigned long gmfn = val >> 12;
         unsigned int idx  = val & 0xfff;
         struct page_info *page;
+        p2m_type_t t;
 
         if ( idx > 0 )
         {
@@ -643,15 +644,22 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
             return 0;
         }
 
-        page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
+        page = get_page_from_gfn(d, gmfn, &t, P2M_ALLOC);
 
         if ( !page || !get_page_type(page, PGT_writable_page) )
         {
             if ( page )
                 put_page(page);
+
+            if ( p2m_is_paging(t) )
+            {
+                p2m_mem_paging_populate(d, gmfn);
+                return -EAGAIN;
+            }
+
             gdprintk(XENLOG_WARNING,
                      "Bad GMFN %lx (MFN %lx) to MSR %08x\n",
-                     gmfn, page_to_mfn(page), base + idx);
+                     gmfn, page ? page_to_mfn(page) : -1UL, base);
             return 0;
         }
 
@@ -2490,7 +2498,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                 goto fail;
             break;
         default:
-            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) )
+            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) == 1 )
                 break;
 
             rc = vmce_wrmsr(regs->ecx, msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01: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 1UZtG7-0002f3-6M; Wed, 08 May 2013 01:33:31 +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 1UZtG6-0002eq-0y
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:30 +0000
Received: from [85.158.143.99:7629] by server-3.bemta-4.messagelabs.com id
	47/AB-02015-96BA9815; Wed, 08 May 2013 01:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367976807!28506125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9329 invoked from network); 8 May 2013 01:33:28 -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;
	8 May 2013 01:33: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 1UZtG2-0001yJ-QB
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtG2-0000io-Ny
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:26 +0000
Date: Wed, 08 May 2013 01:33:26 +0000
Message-Id: <E1UZtG2-0000io-Ny@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: add hooks for claim
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 919f59b3b99e1d845c6a1f30125e79e828805d87
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:49:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:49:18 2013 +0200

    xsm: add hooks for claim
    
    Adds XSM hooks for the recently introduced XENMEM_claim_pages and
    XENMEM_get_outstanding_pages operations, and adds FLASK access vectors
    for them. This makes the access control decisions for these operations
    match those in the rest of the hypervisor.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/modules/xen/xen.if |    2 +-
 xen/common/memory.c                          |   15 ++++++++-------
 xen/include/xsm/dummy.h                      |   12 ++++++++++++
 xen/include/xsm/xsm.h                        |   12 ++++++++++++
 xen/xsm/dummy.c                              |    2 ++
 xen/xsm/flask/hooks.c                        |   13 +++++++++++++
 xen/xsm/flask/policy/access_vectors          |    4 +++-
 7 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 3a59f38..c86a618 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -49,7 +49,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			getscheduler getvcpuinfo getvcpuextstate getaddrsize
 			getaffinity setaffinity };
-	allow $1 $2:domain2 { set_cpuid settsc setscheduler };
+	allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 68501d1..3239d53 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -712,9 +712,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     }
 
     case XENMEM_claim_pages:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-
         if ( copy_from_guest(&reservation, arg, 1) )
             return -EFAULT;
 
@@ -731,17 +728,21 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -EINVAL;
 
-        rc = domain_set_outstanding_pages(d, reservation.nr_extents);
+        rc = xsm_claim_pages(XSM_PRIV, d);
+
+        if ( !rc )
+            rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
         rcu_unlock_domain(d);
 
         break;
 
     case XENMEM_get_outstanding_pages:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
+        rc = xsm_xenmem_get_outstanding_pages(XSM_PRIV);
+
+        if ( !rc )
+            rc = get_outstanding_claims();
 
-        rc = get_outstanding_claims();
         break;
 
     default:
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9cae61c..9bfe596 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -247,6 +247,18 @@ static XSM_INLINE int xsm_memory_pin_page(XSM_DEFAULT_ARG struct domain *d1, str
     return xsm_default_action(action, d1, d2);
 }
 
+static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
+static XSM_INLINE int xsm_xenmem_get_outstanding_pages(XSM_DEFAULT_VOID)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
+}
+
 static XSM_INLINE int xsm_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 5103070..69fe64a 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -92,6 +92,8 @@ struct xsm_operations {
     int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
+    int (*claim_pages) (struct domain *d);
+    int (*xenmem_get_outstanding_pages) (void);
 
     int (*console_io) (struct domain *d, int cmd);
 
@@ -350,6 +352,16 @@ static inline int xsm_remove_from_physmap(xsm_default_t def, struct domain *d1,
     return xsm_ops->remove_from_physmap(d1, d2);
 }
 
+static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->claim_pages(d);
+}
+
+static inline int xsm_xenmem_get_outstanding_pages(xsm_default_t def)
+{
+    return xsm_ops->xenmem_get_outstanding_pages();
+}
+
 static inline int xsm_console_io (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->console_io(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index f7b0399..3d84e73 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -66,6 +66,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, memory_adjust_reservation);
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
+    set_to_dummy_if_null(ops, claim_pages);
+    set_to_dummy_if_null(ops, xenmem_get_outstanding_pages);
 
     set_to_dummy_if_null(ops, console_io);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 04c8a39..3291aa2 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -417,6 +417,17 @@ static int flask_memory_pin_page(struct domain *d1, struct domain *d2,
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PINPAGE);
 }
 
+static int flask_claim_pages(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETCLAIM);
+}
+
+static int flask_xenmem_get_outstanding_pages(void)
+{
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN,
+                                XEN__HEAP, NULL);
+}
+
 static int flask_console_io(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1485,6 +1496,8 @@ static struct xsm_operations flask_ops = {
     .memory_adjust_reservation = flask_memory_adjust_reservation,
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
+    .claim_pages = flask_claim_pages,
+    .xenmem_get_outstanding_pages = flask_xenmem_get_outstanding_pages,
 
     .console_io = flask_console_io,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index c8ae806..544c3ba 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -54,7 +54,7 @@ class xen
     debug
 # XEN_SYSCTL_getcpuinfo, XENPF_get_cpu_version, XENPF_get_cpuinfo
     getcpuinfo
-# XEN_SYSCTL_availheap
+# XEN_SYSCTL_availheap, XENMEM_get_outstanding_pages
     heap
 # XEN_SYSCTL_get_pmstat, XEN_SYSCTL_pm_op, XENPF_set_processor_pminfo,
 # XENPF_core_parking
@@ -192,6 +192,8 @@ class domain2
     settsc
 # XEN_DOMCTL_scheduler_op with XEN_DOMCTL_SCHEDOP_putinfo
     setscheduler
+# XENMEM_claim_pages
+    setclaim
 }
 
 # Similar to class domain, but primarily contains domctls related to HVM domains
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01: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 1UZtG7-0002f3-6M; Wed, 08 May 2013 01:33:31 +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 1UZtG6-0002eq-0y
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:30 +0000
Received: from [85.158.143.99:7629] by server-3.bemta-4.messagelabs.com id
	47/AB-02015-96BA9815; Wed, 08 May 2013 01:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367976807!28506125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9329 invoked from network); 8 May 2013 01:33:28 -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;
	8 May 2013 01:33: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 1UZtG2-0001yJ-QB
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtG2-0000io-Ny
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:26 +0000
Date: Wed, 08 May 2013 01:33:26 +0000
Message-Id: <E1UZtG2-0000io-Ny@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: add hooks for claim
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 919f59b3b99e1d845c6a1f30125e79e828805d87
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:49:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:49:18 2013 +0200

    xsm: add hooks for claim
    
    Adds XSM hooks for the recently introduced XENMEM_claim_pages and
    XENMEM_get_outstanding_pages operations, and adds FLASK access vectors
    for them. This makes the access control decisions for these operations
    match those in the rest of the hypervisor.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/modules/xen/xen.if |    2 +-
 xen/common/memory.c                          |   15 ++++++++-------
 xen/include/xsm/dummy.h                      |   12 ++++++++++++
 xen/include/xsm/xsm.h                        |   12 ++++++++++++
 xen/xsm/dummy.c                              |    2 ++
 xen/xsm/flask/hooks.c                        |   13 +++++++++++++
 xen/xsm/flask/policy/access_vectors          |    4 +++-
 7 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 3a59f38..c86a618 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -49,7 +49,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			getscheduler getvcpuinfo getvcpuextstate getaddrsize
 			getaffinity setaffinity };
-	allow $1 $2:domain2 { set_cpuid settsc setscheduler };
+	allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 68501d1..3239d53 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -712,9 +712,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     }
 
     case XENMEM_claim_pages:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
-
         if ( copy_from_guest(&reservation, arg, 1) )
             return -EFAULT;
 
@@ -731,17 +728,21 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( d == NULL )
             return -EINVAL;
 
-        rc = domain_set_outstanding_pages(d, reservation.nr_extents);
+        rc = xsm_claim_pages(XSM_PRIV, d);
+
+        if ( !rc )
+            rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
         rcu_unlock_domain(d);
 
         break;
 
     case XENMEM_get_outstanding_pages:
-        if ( !IS_PRIV(current->domain) )
-            return -EPERM;
+        rc = xsm_xenmem_get_outstanding_pages(XSM_PRIV);
+
+        if ( !rc )
+            rc = get_outstanding_claims();
 
-        rc = get_outstanding_claims();
         break;
 
     default:
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9cae61c..9bfe596 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -247,6 +247,18 @@ static XSM_INLINE int xsm_memory_pin_page(XSM_DEFAULT_ARG struct domain *d1, str
     return xsm_default_action(action, d1, d2);
 }
 
+static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
+static XSM_INLINE int xsm_xenmem_get_outstanding_pages(XSM_DEFAULT_VOID)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
+}
+
 static XSM_INLINE int xsm_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 5103070..69fe64a 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -92,6 +92,8 @@ struct xsm_operations {
     int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
+    int (*claim_pages) (struct domain *d);
+    int (*xenmem_get_outstanding_pages) (void);
 
     int (*console_io) (struct domain *d, int cmd);
 
@@ -350,6 +352,16 @@ static inline int xsm_remove_from_physmap(xsm_default_t def, struct domain *d1,
     return xsm_ops->remove_from_physmap(d1, d2);
 }
 
+static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->claim_pages(d);
+}
+
+static inline int xsm_xenmem_get_outstanding_pages(xsm_default_t def)
+{
+    return xsm_ops->xenmem_get_outstanding_pages();
+}
+
 static inline int xsm_console_io (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->console_io(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index f7b0399..3d84e73 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -66,6 +66,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, memory_adjust_reservation);
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
+    set_to_dummy_if_null(ops, claim_pages);
+    set_to_dummy_if_null(ops, xenmem_get_outstanding_pages);
 
     set_to_dummy_if_null(ops, console_io);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 04c8a39..3291aa2 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -417,6 +417,17 @@ static int flask_memory_pin_page(struct domain *d1, struct domain *d2,
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PINPAGE);
 }
 
+static int flask_claim_pages(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETCLAIM);
+}
+
+static int flask_xenmem_get_outstanding_pages(void)
+{
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN,
+                                XEN__HEAP, NULL);
+}
+
 static int flask_console_io(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1485,6 +1496,8 @@ static struct xsm_operations flask_ops = {
     .memory_adjust_reservation = flask_memory_adjust_reservation,
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
+    .claim_pages = flask_claim_pages,
+    .xenmem_get_outstanding_pages = flask_xenmem_get_outstanding_pages,
 
     .console_io = flask_console_io,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index c8ae806..544c3ba 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -54,7 +54,7 @@ class xen
     debug
 # XEN_SYSCTL_getcpuinfo, XENPF_get_cpu_version, XENPF_get_cpuinfo
     getcpuinfo
-# XEN_SYSCTL_availheap
+# XEN_SYSCTL_availheap, XENMEM_get_outstanding_pages
     heap
 # XEN_SYSCTL_get_pmstat, XEN_SYSCTL_pm_op, XENPF_set_processor_pminfo,
 # XENPF_core_parking
@@ -192,6 +192,8 @@ class domain2
     settsc
 # XEN_DOMCTL_scheduler_op with XEN_DOMCTL_SCHEDOP_putinfo
     setscheduler
+# XENMEM_claim_pages
+    setclaim
 }
 
 # Similar to class domain, but primarily contains domctls related to HVM domains
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:33: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 1UZtGH-0002gN-BU; Wed, 08 May 2013 01:33: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 1UZtGF-0002g8-UN
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:40 +0000
Received: from [85.158.139.83:8021] by server-5.bemta-5.messagelabs.com id
	92/37-06980-37BA9815; Wed, 08 May 2013 01:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1367976817!27857786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23312 invoked from network); 8 May 2013 01:33:38 -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;
	8 May 2013 01:33: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 1UZtGD-0001yU-3o
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGD-0000jH-1B
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:37 +0000
Date: Wed, 08 May 2013 01:33:37 +0000
Message-Id: <E1UZtGD-0000jH-1B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: remove
	rcu_lock_target_domain_by_id users
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0b201e6f584df8c3766240c6c4a8c04d2f37043e
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:49:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:49:53 2013 +0200

    arm: remove rcu_lock_target_domain_by_id users
    
    This function has been replaced with rcu_lock_domain_by_any_id and an
    XSM check.  Two callers already had an XSM check; add a check to the
    third.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Ian Campbell <ian.campbell@citrix.com> (for thae ARM bits)
---
 xen/arch/arm/mm.c       |   23 +++++++++++++++--------
 xen/include/xsm/dummy.h |    8 ++++++++
 xen/include/xsm/xsm.h   |   11 +++++++++++
 xen/xsm/dummy.c         |    3 +++
 xen/xsm/flask/hooks.c   |   10 ++++++++++
 5 files changed, 47 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 03492df..bd6d5f3 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -753,9 +753,16 @@ static int xenmem_add_to_physmap_one(
     {
         paddr_t maddr;
         struct domain *od;
-        rc = rcu_lock_target_domain_by_id(foreign_domid, &od);
-        if ( rc < 0 )
+        od = rcu_lock_domain_by_any_id(foreign_domid);
+        if ( od == NULL )
+            return -ESRCH;
+
+        rc = xsm_map_gmfn_foreign(XSM_TARGET, d, od);
+        if ( rc )
+        {
+            rcu_unlock_domain(od);
             return rc;
+        }
 
         maddr = p2m_lookup(od, idx << PAGE_SHIFT);
         if ( maddr == INVALID_PADDR )
@@ -847,9 +854,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( xatp.space == XENMAPSPACE_gmfn_foreign )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_add_to_physmap(XSM_TARGET, current->domain, d);
         if ( rc )
@@ -878,9 +885,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( xatpr.space == XENMAPSPACE_gmfn_range )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(xatpr.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatpr.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_add_to_physmap(XSM_TARGET, current->domain, d);
         if ( rc )
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9bfe596..3912bd9 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -616,4 +616,12 @@ static XSM_INLINE int xsm_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint3
     return xsm_default_action(action, current->domain, d);
 }
 
+#endif /* CONFIG_X86 */
+
+#ifdef CONFIG_ARM
+static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
+{
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, t);
+}
 #endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 69fe64a..58a4fbb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -162,6 +162,9 @@ struct xsm_operations {
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
+#ifdef CONFIG_ARM
+    int (*map_gmfn_foreign) (struct domain *d, struct domain *t);
+#endif
 };
 
 #ifdef XSM_ENABLE
@@ -622,6 +625,14 @@ static inline int xsm_ioport_mapping (xsm_default_t def, struct domain *d, uint3
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+
+#ifdef CONFIG_ARM
+static inline int xsm_map_gmfn_foreign (struct domain *d, struct domain *t)
+{
+    return xsm_ops->map_gmfn_foreign(d, t);
+}
+#endif /* CONFIG_ARM */
+
 #endif /* XSM_NO_WRAPPERS */
 
 extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3d84e73..937761f 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -132,4 +132,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
+#ifdef CONFIG_ARM
+    set_to_dummy_if_null(ops, map_gmfn_foreign);
+#endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 3291aa2..bb10de3 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1454,6 +1454,13 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
+#endif /* CONFIG_X86 */
+
+#ifdef CONFIG_ARM
+static int flask_map_gmfn_foreign(struct domain *d, struct domain *t)
+{
+    return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
+}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
@@ -1562,6 +1569,9 @@ static struct xsm_operations flask_ops = {
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
+#ifdef CONFIG_ARM
+    .map_gmfn_foreign = flask_map_gmfn_foreign,
+#endif
 };
 
 static __init int flask_init(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:33: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 1UZtGH-0002gN-BU; Wed, 08 May 2013 01:33: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 1UZtGF-0002g8-UN
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:40 +0000
Received: from [85.158.139.83:8021] by server-5.bemta-5.messagelabs.com id
	92/37-06980-37BA9815; Wed, 08 May 2013 01:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1367976817!27857786!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23312 invoked from network); 8 May 2013 01:33:38 -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;
	8 May 2013 01:33: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 1UZtGD-0001yU-3o
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGD-0000jH-1B
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:37 +0000
Date: Wed, 08 May 2013 01:33:37 +0000
Message-Id: <E1UZtGD-0000jH-1B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: remove
	rcu_lock_target_domain_by_id users
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0b201e6f584df8c3766240c6c4a8c04d2f37043e
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:49:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:49:53 2013 +0200

    arm: remove rcu_lock_target_domain_by_id users
    
    This function has been replaced with rcu_lock_domain_by_any_id and an
    XSM check.  Two callers already had an XSM check; add a check to the
    third.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Ian Campbell <ian.campbell@citrix.com> (for thae ARM bits)
---
 xen/arch/arm/mm.c       |   23 +++++++++++++++--------
 xen/include/xsm/dummy.h |    8 ++++++++
 xen/include/xsm/xsm.h   |   11 +++++++++++
 xen/xsm/dummy.c         |    3 +++
 xen/xsm/flask/hooks.c   |   10 ++++++++++
 5 files changed, 47 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 03492df..bd6d5f3 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -753,9 +753,16 @@ static int xenmem_add_to_physmap_one(
     {
         paddr_t maddr;
         struct domain *od;
-        rc = rcu_lock_target_domain_by_id(foreign_domid, &od);
-        if ( rc < 0 )
+        od = rcu_lock_domain_by_any_id(foreign_domid);
+        if ( od == NULL )
+            return -ESRCH;
+
+        rc = xsm_map_gmfn_foreign(XSM_TARGET, d, od);
+        if ( rc )
+        {
+            rcu_unlock_domain(od);
             return rc;
+        }
 
         maddr = p2m_lookup(od, idx << PAGE_SHIFT);
         if ( maddr == INVALID_PADDR )
@@ -847,9 +854,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( xatp.space == XENMAPSPACE_gmfn_foreign )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(xatp.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatp.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_add_to_physmap(XSM_TARGET, current->domain, d);
         if ( rc )
@@ -878,9 +885,9 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( xatpr.space == XENMAPSPACE_gmfn_range )
             return -EINVAL;
 
-        rc = rcu_lock_target_domain_by_id(xatpr.domid, &d);
-        if ( rc != 0 )
-            return rc;
+        d = rcu_lock_domain_by_any_id(xatpr.domid);
+        if ( d == NULL )
+            return -ESRCH;
 
         rc = xsm_add_to_physmap(XSM_TARGET, current->domain, d);
         if ( rc )
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9bfe596..3912bd9 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -616,4 +616,12 @@ static XSM_INLINE int xsm_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint3
     return xsm_default_action(action, current->domain, d);
 }
 
+#endif /* CONFIG_X86 */
+
+#ifdef CONFIG_ARM
+static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
+{
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, t);
+}
 #endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 69fe64a..58a4fbb 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -162,6 +162,9 @@ struct xsm_operations {
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
+#ifdef CONFIG_ARM
+    int (*map_gmfn_foreign) (struct domain *d, struct domain *t);
+#endif
 };
 
 #ifdef XSM_ENABLE
@@ -622,6 +625,14 @@ static inline int xsm_ioport_mapping (xsm_default_t def, struct domain *d, uint3
     return xsm_ops->ioport_mapping(d, s, e, allow);
 }
 #endif /* CONFIG_X86 */
+
+#ifdef CONFIG_ARM
+static inline int xsm_map_gmfn_foreign (struct domain *d, struct domain *t)
+{
+    return xsm_ops->map_gmfn_foreign(d, t);
+}
+#endif /* CONFIG_ARM */
+
 #endif /* XSM_NO_WRAPPERS */
 
 extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi,
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 3d84e73..937761f 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -132,4 +132,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
+#ifdef CONFIG_ARM
+    set_to_dummy_if_null(ops, map_gmfn_foreign);
+#endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 3291aa2..bb10de3 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1454,6 +1454,13 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
 }
+#endif /* CONFIG_X86 */
+
+#ifdef CONFIG_ARM
+static int flask_map_gmfn_foreign(struct domain *d, struct domain *t)
+{
+    return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
+}
 #endif
 
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
@@ -1562,6 +1569,9 @@ static struct xsm_operations flask_ops = {
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
+#ifdef CONFIG_ARM
+    .map_gmfn_foreign = flask_map_gmfn_foreign,
+#endif
 };
 
 static __init int flask_init(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:33: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 1UZtGR-0002i5-EO; Wed, 08 May 2013 01:33: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 1UZtGP-0002hf-UR
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:50 +0000
Received: from [193.109.254.147:36860] by server-5.bemta-14.messagelabs.com id
	52/9B-18535-D7BA9815; Wed, 08 May 2013 01:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1367976827!842274!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30150 invoked from network); 8 May 2013 01:33:48 -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;
	8 May 2013 01:33: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 1UZtGN-0001yg-A8
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGN-0000jg-7Y
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:47 +0000
Date: Wed, 08 May 2013 01:33:47 +0000
Message-Id: <E1UZtGN-0000jg-7Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common: remove
	rcu_lock_target_domain_by_id
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f3d7d1b2c5124d88d27a70a5f02a3c14fd169d42
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:50:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:50:28 2013 +0200

    common: remove rcu_lock_target_domain_by_id
    
    This function (and rcu_lock_remote_target_domain_by_id) has no remaining
    users, having been replaced with XSM hooks and the other rcu_lock_*
    functions. Remove it.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/domain.c     |   34 ----------------------------------
 xen/include/xen/sched.h |   14 --------------
 2 files changed, 0 insertions(+), 48 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index b5d44d4..8adf00a 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -481,40 +481,6 @@ struct domain *rcu_lock_domain_by_any_id(domid_t dom)
     return rcu_lock_domain_by_id(dom);
 }
 
-int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d)
-{
-    if ( dom == DOMID_SELF )
-    {
-        *d = rcu_lock_current_domain();
-        return 0;
-    }
-
-    if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
-        return -ESRCH;
-
-    if ( !IS_PRIV_FOR(current->domain, *d) )
-    {
-        rcu_unlock_domain(*d);
-        return -EPERM;
-    }
-
-    return 0;
-}
-
-int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d)
-{
-    if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
-        return -ESRCH;
-
-    if ( (*d == current->domain) || !IS_PRIV_FOR(current->domain, *d) )
-    {
-        rcu_unlock_domain(*d);
-        return -EPERM;
-    }
-
-    return 0;
-}
-
 int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
 {
     if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 41f749e..cb3baed 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -477,20 +477,6 @@ struct domain *rcu_lock_domain_by_id(domid_t dom);
 struct domain *rcu_lock_domain_by_any_id(domid_t dom);
 
 /*
- * As above function, but accounts for current domain context:
- *  - Translates target DOMID_SELF into caller's domain id; and
- *  - Checks that caller has permission to act on the target domain.
- */
-int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d);
-
-/*
- * As rcu_lock_target_domain_by_id(), but will fail EPERM rather than resolve
- * to local domain. Successful return always resolves to a remote domain that
- * the local domain is privileged to control.
- */
-int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
-
-/*
  * As rcu_lock_domain_by_id(), but will fail EPERM or ESRCH rather than resolve
  * to local domain.
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:33:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:33: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 1UZtGR-0002i5-EO; Wed, 08 May 2013 01:33: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 1UZtGP-0002hf-UR
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:50 +0000
Received: from [193.109.254.147:36860] by server-5.bemta-14.messagelabs.com id
	52/9B-18535-D7BA9815; Wed, 08 May 2013 01:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1367976827!842274!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30150 invoked from network); 8 May 2013 01:33:48 -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;
	8 May 2013 01:33: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 1UZtGN-0001yg-A8
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGN-0000jg-7Y
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:47 +0000
Date: Wed, 08 May 2013 01:33:47 +0000
Message-Id: <E1UZtGN-0000jg-7Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common: remove
	rcu_lock_target_domain_by_id
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f3d7d1b2c5124d88d27a70a5f02a3c14fd169d42
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:50:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:50:28 2013 +0200

    common: remove rcu_lock_target_domain_by_id
    
    This function (and rcu_lock_remote_target_domain_by_id) has no remaining
    users, having been replaced with XSM hooks and the other rcu_lock_*
    functions. Remove it.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/domain.c     |   34 ----------------------------------
 xen/include/xen/sched.h |   14 --------------
 2 files changed, 0 insertions(+), 48 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index b5d44d4..8adf00a 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -481,40 +481,6 @@ struct domain *rcu_lock_domain_by_any_id(domid_t dom)
     return rcu_lock_domain_by_id(dom);
 }
 
-int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d)
-{
-    if ( dom == DOMID_SELF )
-    {
-        *d = rcu_lock_current_domain();
-        return 0;
-    }
-
-    if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
-        return -ESRCH;
-
-    if ( !IS_PRIV_FOR(current->domain, *d) )
-    {
-        rcu_unlock_domain(*d);
-        return -EPERM;
-    }
-
-    return 0;
-}
-
-int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d)
-{
-    if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
-        return -ESRCH;
-
-    if ( (*d == current->domain) || !IS_PRIV_FOR(current->domain, *d) )
-    {
-        rcu_unlock_domain(*d);
-        return -EPERM;
-    }
-
-    return 0;
-}
-
 int rcu_lock_remote_domain_by_id(domid_t dom, struct domain **d)
 {
     if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 41f749e..cb3baed 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -477,20 +477,6 @@ struct domain *rcu_lock_domain_by_id(domid_t dom);
 struct domain *rcu_lock_domain_by_any_id(domid_t dom);
 
 /*
- * As above function, but accounts for current domain context:
- *  - Translates target DOMID_SELF into caller's domain id; and
- *  - Checks that caller has permission to act on the target domain.
- */
-int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d);
-
-/*
- * As rcu_lock_target_domain_by_id(), but will fail EPERM rather than resolve
- * to local domain. Successful return always resolves to a remote domain that
- * the local domain is privileged to control.
- */
-int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
-
-/*
  * As rcu_lock_domain_by_id(), but will fail EPERM or ESRCH rather than resolve
  * to local domain.
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtGh-0002l9-He; Wed, 08 May 2013 01:34:07 +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 1UZtGf-0002kf-T8
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:06 +0000
Received: from [85.158.138.51:64219] by server-16.bemta-3.messagelabs.com id
	2B/E9-23964-88BA9815; Wed, 08 May 2013 01:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1367976837!29296614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22208 invoked from network); 8 May 2013 01:33:58 -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;
	8 May 2013 01:33: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 1UZtGX-0001yn-Ij
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGX-0000k2-G6
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:57 +0000
Date: Wed, 08 May 2013 01:33:57 +0000
Message-Id: <E1UZtGX-0000k2-G6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] rename IS_PRIV to is_hardware_domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3b77afc7f3bfce1fa09b4cf3d54b4463cf4c216f
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:51:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:51:19 2013 +0200

    rename IS_PRIV to is_hardware_domain
    
    Since the remaining uses of IS_PRIV are actually concerned with the
    domain having control of the hardware (i.e. being the initial domain),
    clarify this by renaming IS_PRIV to is_hardware_domain.  This also
    removes IS_PRIV_FOR since the only remaining user was xsm/dummy.h.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domctl.c   |    6 +++---
 xen/arch/x86/msi.c      |    2 +-
 xen/arch/x86/physdev.c  |    4 ++--
 xen/arch/x86/traps.c    |   12 ++++++------
 xen/include/xen/sched.h |   12 ++++++++++--
 xen/include/xsm/dummy.h |   32 ++++++++++++++++++++------------
 6 files changed, 42 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1f16ad2..c2a04c4 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -661,7 +661,7 @@ long arch_do_domctl(
                     while ( i-- )
                         clear_mmio_p2m_entry(d, gfn + i);
                     if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
-                         IS_PRIV(current->domain) )
+                         is_hardware_domain(current->domain) )
                         printk(XENLOG_ERR
                                "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
                                d->domain_id, mfn, mfn + nr_mfns - 1);
@@ -680,7 +680,7 @@ long arch_do_domctl(
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
             if ( !ret && add )
                 ret = -EIO;
-            if ( ret && IS_PRIV(current->domain) )
+            if ( ret && is_hardware_domain(current->domain) )
                 printk(XENLOG_ERR
                        "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
                        ret, add ? "removing" : "denying", d->domain_id,
@@ -767,7 +767,7 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
-            if ( ret && IS_PRIV(current->domain) )
+            if ( ret && is_hardware_domain(current->domain) )
                 printk(XENLOG_ERR
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 36bed29..a2ceea0 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -812,7 +812,7 @@ static int msix_capability_init(struct pci_dev *dev,
                         break;
             if ( d )
             {
-                if ( !IS_PRIV(d) && dev->msix_warned != d->domain_id )
+                if ( !is_hardware_domain(d) && dev->msix_warned != d->domain_id )
                 {
                     dev->msix_warned = d->domain_id;
                     printk(XENLOG_ERR
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index eb8a407..3733c7a 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -128,7 +128,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
         irq = domain_pirq_to_irq(current->domain, *index);
         if ( irq <= 0 )
         {
-            if ( IS_PRIV(current->domain) )
+            if ( is_hardware_domain(current->domain) )
                 irq = *index;
             else {
                 dprintk(XENLOG_G_ERR, "dom%d: map pirq with incorrect irq!\n",
@@ -691,7 +691,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_dbgp_op: {
         struct physdev_dbgp_op op;
 
-        if ( !IS_PRIV(v->domain) )
+        if ( !is_hardware_domain(v->domain) )
             ret = -EPERM;
         else if ( copy_from_guest(&op, arg, 1) )
             ret = -EFAULT;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f630f83..48fe468 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1311,7 +1311,7 @@ static int fixup_page_fault(unsigned long addr, struct cpu_user_regs *regs)
              ptwr_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
 
-        if ( IS_PRIV(d) && (regs->error_code & PFEC_page_present) &&
+        if ( is_hardware_domain(d) && (regs->error_code & PFEC_page_present) &&
              mmio_ro_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
     }
@@ -1631,7 +1631,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
 {
     uint32_t machine_bdf;
     uint16_t start, end;
-    if (!IS_PRIV(d))
+    if (!is_hardware_domain(d))
         return 0;
 
     machine_bdf = (d->arch.pci_cf8 >> 8) & 0xFFFF;
@@ -2423,7 +2423,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
                  boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 > 0x17 )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( (rdmsr_safe(MSR_AMD64_NB_CFG, val) != 0) ||
                  (eax != (uint32_t)val) ||
@@ -2436,7 +2436,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
                  boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 > 0x17 )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) )
                 goto fail;
@@ -2456,7 +2456,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case MSR_IA32_UCODE_REV:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( rdmsr_safe(regs->ecx, val) )
                 goto fail;
@@ -2492,7 +2492,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case MSR_IA32_ENERGY_PERF_BIAS:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( wrmsr_safe(regs->ecx, msr_content) != 0 )
                 goto fail;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index cb3baed..5b55c09 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -716,8 +716,16 @@ uint64_t get_cpu_idle_time(unsigned int cpu);
 void watchdog_domain_init(struct domain *d);
 void watchdog_domain_destroy(struct domain *d);
 
-#define IS_PRIV(_d) ((_d)->is_privileged)
-#define IS_PRIV_FOR(_d, _t) (IS_PRIV(_d) || ((_d)->target && (_d)->target == (_t)))
+/* 
+ * Use this check when the following are both true:
+ *  - Using this feature or interface requires full access to the hardware
+ *    (that is, this is would not be suitable for a driver domain)
+ *  - There is never a reason to deny dom0 access to this
+ */
+#define is_hardware_domain(_d) ((_d)->is_privileged)
+
+/* This check is for functionality specific to a control domain */
+#define is_control_domain(_d) ((_d)->is_privileged)
 
 #define VM_ASSIST(_d,_t) (test_bit((_t), &(_d)->vm_assist))
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 3912bd9..a872056 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -60,17 +60,23 @@ static always_inline int xsm_default_action(
     case XSM_HOOK:
         return 0;
     case XSM_DM_PRIV:
-        if ( !IS_PRIV_FOR(src, target) )
-            return -EPERM;
-        return 0;
+        if ( src->is_privileged )
+            return 0;
+        if ( target && src->target == target )
+            return 0;
+        return -EPERM;
     case XSM_TARGET:
-        if ( src != target && !IS_PRIV_FOR(src, target) )
-            return -EPERM;
-        return 0;
+        if ( src == target )
+            return 0;
+        if ( src->is_privileged )
+            return 0;
+        if ( target && src->target == target )
+            return 0;
+        return -EPERM;
     case XSM_PRIV:
-        if ( !IS_PRIV(src) )
-            return -EPERM;
-        return 0;
+        if ( src->is_privileged )
+            return 0;
+        return -EPERM;
     default:
         LINKER_BUG_ON(1);
         return -EPERM;
@@ -567,10 +573,12 @@ static XSM_INLINE int xsm_domain_memory_map(XSM_DEFAULT_ARG struct domain *d)
 static XSM_INLINE int xsm_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
+    int rc;
     XSM_ASSERT_ACTION(XSM_TARGET);
-    if ( t && d != t && !IS_PRIV_FOR(d, t) )
-        return -EPERM;
-    return xsm_default_action(action, d, f);
+    rc = xsm_default_action(action, d, f);
+    if ( t && !rc )
+        rc = xsm_default_action(action, d, t);
+    return rc;
 }
 
 static XSM_INLINE int xsm_mmuext_op(XSM_DEFAULT_ARG struct domain *d, struct domain *f)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtGh-0002l9-He; Wed, 08 May 2013 01:34:07 +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 1UZtGf-0002kf-T8
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:06 +0000
Received: from [85.158.138.51:64219] by server-16.bemta-3.messagelabs.com id
	2B/E9-23964-88BA9815; Wed, 08 May 2013 01:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1367976837!29296614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22208 invoked from network); 8 May 2013 01:33:58 -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;
	8 May 2013 01:33: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 1UZtGX-0001yn-Ij
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGX-0000k2-G6
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:33:57 +0000
Date: Wed, 08 May 2013 01:33:57 +0000
Message-Id: <E1UZtGX-0000k2-G6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] rename IS_PRIV to is_hardware_domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3b77afc7f3bfce1fa09b4cf3d54b4463cf4c216f
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue May 7 16:51:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:51:19 2013 +0200

    rename IS_PRIV to is_hardware_domain
    
    Since the remaining uses of IS_PRIV are actually concerned with the
    domain having control of the hardware (i.e. being the initial domain),
    clarify this by renaming IS_PRIV to is_hardware_domain.  This also
    removes IS_PRIV_FOR since the only remaining user was xsm/dummy.h.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domctl.c   |    6 +++---
 xen/arch/x86/msi.c      |    2 +-
 xen/arch/x86/physdev.c  |    4 ++--
 xen/arch/x86/traps.c    |   12 ++++++------
 xen/include/xen/sched.h |   12 ++++++++++--
 xen/include/xsm/dummy.h |   32 ++++++++++++++++++++------------
 6 files changed, 42 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1f16ad2..c2a04c4 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -661,7 +661,7 @@ long arch_do_domctl(
                     while ( i-- )
                         clear_mmio_p2m_entry(d, gfn + i);
                     if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) &&
-                         IS_PRIV(current->domain) )
+                         is_hardware_domain(current->domain) )
                         printk(XENLOG_ERR
                                "memory_map: failed to deny dom%d access to [%lx,%lx]\n",
                                d->domain_id, mfn, mfn + nr_mfns - 1);
@@ -680,7 +680,7 @@ long arch_do_domctl(
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
             if ( !ret && add )
                 ret = -EIO;
-            if ( ret && IS_PRIV(current->domain) )
+            if ( ret && is_hardware_domain(current->domain) )
                 printk(XENLOG_ERR
                        "memory_map: error %ld %s dom%d access to [%lx,%lx]\n",
                        ret, add ? "removing" : "denying", d->domain_id,
@@ -767,7 +767,7 @@ long arch_do_domctl(
                     break;
                 }
             ret = ioports_deny_access(d, fmp, fmp + np - 1);
-            if ( ret && IS_PRIV(current->domain) )
+            if ( ret && is_hardware_domain(current->domain) )
                 printk(XENLOG_ERR
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 36bed29..a2ceea0 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -812,7 +812,7 @@ static int msix_capability_init(struct pci_dev *dev,
                         break;
             if ( d )
             {
-                if ( !IS_PRIV(d) && dev->msix_warned != d->domain_id )
+                if ( !is_hardware_domain(d) && dev->msix_warned != d->domain_id )
                 {
                     dev->msix_warned = d->domain_id;
                     printk(XENLOG_ERR
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index eb8a407..3733c7a 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -128,7 +128,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
         irq = domain_pirq_to_irq(current->domain, *index);
         if ( irq <= 0 )
         {
-            if ( IS_PRIV(current->domain) )
+            if ( is_hardware_domain(current->domain) )
                 irq = *index;
             else {
                 dprintk(XENLOG_G_ERR, "dom%d: map pirq with incorrect irq!\n",
@@ -691,7 +691,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_dbgp_op: {
         struct physdev_dbgp_op op;
 
-        if ( !IS_PRIV(v->domain) )
+        if ( !is_hardware_domain(v->domain) )
             ret = -EPERM;
         else if ( copy_from_guest(&op, arg, 1) )
             ret = -EFAULT;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f630f83..48fe468 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1311,7 +1311,7 @@ static int fixup_page_fault(unsigned long addr, struct cpu_user_regs *regs)
              ptwr_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
 
-        if ( IS_PRIV(d) && (regs->error_code & PFEC_page_present) &&
+        if ( is_hardware_domain(d) && (regs->error_code & PFEC_page_present) &&
              mmio_ro_do_page_fault(v, addr, regs) )
             return EXCRET_fault_fixed;
     }
@@ -1631,7 +1631,7 @@ static int pci_cfg_ok(struct domain *d, int write, int size)
 {
     uint32_t machine_bdf;
     uint16_t start, end;
-    if (!IS_PRIV(d))
+    if (!is_hardware_domain(d))
         return 0;
 
     machine_bdf = (d->arch.pci_cf8 >> 8) & 0xFFFF;
@@ -2423,7 +2423,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
                  boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 > 0x17 )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( (rdmsr_safe(MSR_AMD64_NB_CFG, val) != 0) ||
                  (eax != (uint32_t)val) ||
@@ -2436,7 +2436,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
                  boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 > 0x17 )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( (rdmsr_safe(MSR_FAM10H_MMIO_CONF_BASE, val) != 0) )
                 goto fail;
@@ -2456,7 +2456,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case MSR_IA32_UCODE_REV:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( rdmsr_safe(regs->ecx, val) )
                 goto fail;
@@ -2492,7 +2492,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case MSR_IA32_ENERGY_PERF_BIAS:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 goto fail;
-            if ( !IS_PRIV(v->domain) || !is_pinned_vcpu(v) )
+            if ( !is_hardware_domain(v->domain) || !is_pinned_vcpu(v) )
                 break;
             if ( wrmsr_safe(regs->ecx, msr_content) != 0 )
                 goto fail;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index cb3baed..5b55c09 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -716,8 +716,16 @@ uint64_t get_cpu_idle_time(unsigned int cpu);
 void watchdog_domain_init(struct domain *d);
 void watchdog_domain_destroy(struct domain *d);
 
-#define IS_PRIV(_d) ((_d)->is_privileged)
-#define IS_PRIV_FOR(_d, _t) (IS_PRIV(_d) || ((_d)->target && (_d)->target == (_t)))
+/* 
+ * Use this check when the following are both true:
+ *  - Using this feature or interface requires full access to the hardware
+ *    (that is, this is would not be suitable for a driver domain)
+ *  - There is never a reason to deny dom0 access to this
+ */
+#define is_hardware_domain(_d) ((_d)->is_privileged)
+
+/* This check is for functionality specific to a control domain */
+#define is_control_domain(_d) ((_d)->is_privileged)
 
 #define VM_ASSIST(_d,_t) (test_bit((_t), &(_d)->vm_assist))
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 3912bd9..a872056 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -60,17 +60,23 @@ static always_inline int xsm_default_action(
     case XSM_HOOK:
         return 0;
     case XSM_DM_PRIV:
-        if ( !IS_PRIV_FOR(src, target) )
-            return -EPERM;
-        return 0;
+        if ( src->is_privileged )
+            return 0;
+        if ( target && src->target == target )
+            return 0;
+        return -EPERM;
     case XSM_TARGET:
-        if ( src != target && !IS_PRIV_FOR(src, target) )
-            return -EPERM;
-        return 0;
+        if ( src == target )
+            return 0;
+        if ( src->is_privileged )
+            return 0;
+        if ( target && src->target == target )
+            return 0;
+        return -EPERM;
     case XSM_PRIV:
-        if ( !IS_PRIV(src) )
-            return -EPERM;
-        return 0;
+        if ( src->is_privileged )
+            return 0;
+        return -EPERM;
     default:
         LINKER_BUG_ON(1);
         return -EPERM;
@@ -567,10 +573,12 @@ static XSM_INLINE int xsm_domain_memory_map(XSM_DEFAULT_ARG struct domain *d)
 static XSM_INLINE int xsm_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
+    int rc;
     XSM_ASSERT_ACTION(XSM_TARGET);
-    if ( t && d != t && !IS_PRIV_FOR(d, t) )
-        return -EPERM;
-    return xsm_default_action(action, d, f);
+    rc = xsm_default_action(action, d, f);
+    if ( t && !rc )
+        rc = xsm_default_action(action, d, t);
+    return rc;
 }
 
 static XSM_INLINE int xsm_mmuext_op(XSM_DEFAULT_ARG struct domain *d, struct domain *f)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtGn-0002mP-KQ; Wed, 08 May 2013 01:34: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 1UZtGl-0002lh-NK
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:11 +0000
Received: from [85.158.138.51:9639] by server-1.bemta-3.messagelabs.com id
	57/09-20211-19BA9815; Wed, 08 May 2013 01:34:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1367976847!23672005!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21238 invoked from network); 8 May 2013 01:34:09 -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;
	8 May 2013 01:34: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 1UZtGh-0001zL-Q1
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGh-0000kw-N6
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:07 +0000
Date: Wed, 08 May 2013 01:34:07 +0000
Message-Id: <E1UZtGh-0000kw-N6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif: define XEN_NETIF_MAX_TX_SIZE in
	public header
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 df76bf093ee29324b57267154232d0d792c8de43
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 7 16:54:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:54:44 2013 +0200

    netif: define XEN_NETIF_MAX_TX_SIZE in public header
    
    This is the maximum supported size of a packet. It comes from the size of
    netif_tx_request.size.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/io/netif.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index b184e49..ccde53b 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -65,6 +65,7 @@
 #define _NETTXF_extra_info     (3)
 #define  NETTXF_extra_info     (1U<<_NETTXF_extra_info)
 
+#define XEN_NETIF_MAX_TX_SIZE 0xFFFF
 struct netif_tx_request {
     grant_ref_t gref;      /* Reference to buffer page */
     uint16_t offset;       /* Offset within buffer page */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtGn-0002mP-KQ; Wed, 08 May 2013 01:34: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 1UZtGl-0002lh-NK
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:11 +0000
Received: from [85.158.138.51:9639] by server-1.bemta-3.messagelabs.com id
	57/09-20211-19BA9815; Wed, 08 May 2013 01:34:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1367976847!23672005!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21238 invoked from network); 8 May 2013 01:34:09 -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;
	8 May 2013 01:34: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 1UZtGh-0001zL-Q1
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGh-0000kw-N6
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:07 +0000
Date: Wed, 08 May 2013 01:34:07 +0000
Message-Id: <E1UZtGh-0000kw-N6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif: define XEN_NETIF_MAX_TX_SIZE in
	public header
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 df76bf093ee29324b57267154232d0d792c8de43
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 7 16:54:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:54:44 2013 +0200

    netif: define XEN_NETIF_MAX_TX_SIZE in public header
    
    This is the maximum supported size of a packet. It comes from the size of
    netif_tx_request.size.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/io/netif.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index b184e49..ccde53b 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -65,6 +65,7 @@
 #define _NETTXF_extra_info     (3)
 #define  NETTXF_extra_info     (1U<<_NETTXF_extra_info)
 
+#define XEN_NETIF_MAX_TX_SIZE 0xFFFF
 struct netif_tx_request {
     grant_ref_t gref;      /* Reference to buffer page */
     uint16_t offset;       /* Offset within buffer page */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtGv-0002o6-N8; Wed, 08 May 2013 01:34: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 1UZtGu-0002ni-I6
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:20 +0000
Received: from [85.158.139.83:8918] by server-2.bemta-5.messagelabs.com id
	E3/59-26552-B9BA9815; Wed, 08 May 2013 01:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1367976858!29370256!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24437 invoked from network); 8 May 2013 01:34:19 -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;
	8 May 2013 01:34: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 1UZtGs-0001zR-0e
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGr-0000lK-Uk
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:17 +0000
Date: Wed, 08 May 2013 01:34:17 +0000
Message-Id: <E1UZtGr-0000lK-Uk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif: define XEN_NETIF_NR_SLOTS_MIN
	in public header
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 723a375f4e283f2d2b730e98cf6f6cc226423a7f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 7 16:54:56 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:54:56 2013 +0200

    netif: define XEN_NETIF_NR_SLOTS_MIN in public header
    
    Xen network protocol has implicit dependency on MAX_SKB_FRAGS. In order to
    remove dependency on MAX_SKB_FRAGS, we derive a constant from historical
    MAX_SKB_FRAGS for future reference.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/io/netif.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index ccde53b..9664998 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -31,6 +31,24 @@
 #include "../grant_table.h"
 
 /*
+ * Older implementation of Xen network frontend / backend has an
+ * implicit dependency on the MAX_SKB_FRAGS as the maximum number of
+ * ring slots a skb can use. Netfront / netback may not work as
+ * expected when frontend and backend have different MAX_SKB_FRAGS.
+ *
+ * A better approach is to add mechanism for netfront / netback to
+ * negotiate this value. However we cannot fix all possible
+ * frontends, so we need to define a value which states the minimum
+ * slots backend must support.
+ *
+ * The minimum value derives from older Linux kernel's MAX_SKB_FRAGS
+ * (18), which is proved to work with most frontends. Any new backend
+ * which doesn't negotiate with frontend should expect frontend to
+ * send a valid packet using slots up to this value.
+ */
+#define XEN_NETIF_NR_SLOTS_MIN 18
+
+/*
  * Notifications after enqueuing any type of message should be conditional on
  * the appropriate req_event or rsp_event field in the shared ring.
  * If the client sends notification for rx requests then it should specify
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtGv-0002o6-N8; Wed, 08 May 2013 01:34: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 1UZtGu-0002ni-I6
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:20 +0000
Received: from [85.158.139.83:8918] by server-2.bemta-5.messagelabs.com id
	E3/59-26552-B9BA9815; Wed, 08 May 2013 01:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1367976858!29370256!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24437 invoked from network); 8 May 2013 01:34:19 -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;
	8 May 2013 01:34: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 1UZtGs-0001zR-0e
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtGr-0000lK-Uk
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:17 +0000
Date: Wed, 08 May 2013 01:34:17 +0000
Message-Id: <E1UZtGr-0000lK-Uk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif: define XEN_NETIF_NR_SLOTS_MIN
	in public header
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 723a375f4e283f2d2b730e98cf6f6cc226423a7f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 7 16:54:56 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 16:54:56 2013 +0200

    netif: define XEN_NETIF_NR_SLOTS_MIN in public header
    
    Xen network protocol has implicit dependency on MAX_SKB_FRAGS. In order to
    remove dependency on MAX_SKB_FRAGS, we derive a constant from historical
    MAX_SKB_FRAGS for future reference.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/io/netif.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index ccde53b..9664998 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -31,6 +31,24 @@
 #include "../grant_table.h"
 
 /*
+ * Older implementation of Xen network frontend / backend has an
+ * implicit dependency on the MAX_SKB_FRAGS as the maximum number of
+ * ring slots a skb can use. Netfront / netback may not work as
+ * expected when frontend and backend have different MAX_SKB_FRAGS.
+ *
+ * A better approach is to add mechanism for netfront / netback to
+ * negotiate this value. However we cannot fix all possible
+ * frontends, so we need to define a value which states the minimum
+ * slots backend must support.
+ *
+ * The minimum value derives from older Linux kernel's MAX_SKB_FRAGS
+ * (18), which is proved to work with most frontends. Any new backend
+ * which doesn't negotiate with frontend should expect frontend to
+ * send a valid packet using slots up to this value.
+ */
+#define XEN_NETIF_NR_SLOTS_MIN 18
+
+/*
  * Notifications after enqueuing any type of message should be conditional on
  * the appropriate req_event or rsp_event field in the shared ring.
  * If the client sends notification for rx requests then it should specify
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtH5-0002qG-S6; Wed, 08 May 2013 01:34:31 +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 1UZtH4-0002pu-NG
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:30 +0000
Received: from [85.158.143.99:11102] by server-3.bemta-4.messagelabs.com id
	99/DB-02015-6ABA9815; Wed, 08 May 2013 01:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1367976868!21676386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14432 invoked from network); 8 May 2013 01:34:29 -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;
	8 May 2013 01:34: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 1UZtH2-0001za-8H
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtH2-0000lg-4v
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:28 +0000
Date: Wed, 08 May 2013 01:34:28 +0000
Message-Id: <E1UZtH2-0000lg-4v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Fix efi directory 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

commit 6f3059e0e05b72c3cc7246f3e6e81f80761b98cb
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 17:02:00 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 17:02:00 2013 +0200

    x86: Fix efi directory cleanup
    
    clean target is never called from xen/arch/x86/efi/Makefile.
    Move all needed stuff to xen/arch/x86/Makefile
    and additionally remove efi.lds.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/arch/x86/Makefile     |    4 ++--
 xen/arch/x86/efi/Makefile |    3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 0fe547b..d502bdf 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -166,7 +166,7 @@ efi/mkreloc: efi/mkreloc.c
 
 .PHONY: clean
 clean::
-	rm -f asm-offsets.s xen.lds boot/*.o boot/*~ boot/core boot/mkelf32
+	rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32
 	rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d
-	rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.o efi/mkreloc efi/.*.d
+	rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.o efi/.*.d efi/*.efi efi/disabled efi/mkreloc
 	rm -f boot/reloc.S boot/reloc.lnk boot/reloc.bin
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 514dba0..1daa7ac 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -12,6 +12,3 @@ efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(c
 extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o
 
 stub.o: $(extra-y)
-
-clean::
-	rm -f disabled *.efi
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 01:34:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 01:34: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 1UZtH5-0002qG-S6; Wed, 08 May 2013 01:34:31 +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 1UZtH4-0002pu-NG
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:30 +0000
Received: from [85.158.143.99:11102] by server-3.bemta-4.messagelabs.com id
	99/DB-02015-6ABA9815; Wed, 08 May 2013 01:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1367976868!21676386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14432 invoked from network); 8 May 2013 01:34:29 -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;
	8 May 2013 01:34: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 1UZtH2-0001za-8H
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UZtH2-0000lg-4v
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 01:34:28 +0000
Date: Wed, 08 May 2013 01:34:28 +0000
Message-Id: <E1UZtH2-0000lg-4v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Fix efi directory 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

commit 6f3059e0e05b72c3cc7246f3e6e81f80761b98cb
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 17:02:00 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 7 17:02:00 2013 +0200

    x86: Fix efi directory cleanup
    
    clean target is never called from xen/arch/x86/efi/Makefile.
    Move all needed stuff to xen/arch/x86/Makefile
    and additionally remove efi.lds.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/arch/x86/Makefile     |    4 ++--
 xen/arch/x86/efi/Makefile |    3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 0fe547b..d502bdf 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -166,7 +166,7 @@ efi/mkreloc: efi/mkreloc.c
 
 .PHONY: clean
 clean::
-	rm -f asm-offsets.s xen.lds boot/*.o boot/*~ boot/core boot/mkelf32
+	rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32
 	rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d
-	rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.o efi/mkreloc efi/.*.d
+	rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.o efi/.*.d efi/*.efi efi/disabled efi/mkreloc
 	rm -f boot/reloc.S boot/reloc.lnk boot/reloc.bin
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 514dba0..1daa7ac 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -12,6 +12,3 @@ efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(c
 extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o
 
 stub.o: $(extra-y)
-
-clean::
-	rm -f disabled *.efi
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18: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 1Ua9WF-0005gj-TV; Wed, 08 May 2013 18:55:15 +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 1Ua9WE-0005ge-7u
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:14 +0000
Received: from [85.158.143.99:26581] by server-2.bemta-4.messagelabs.com id
	F9/FD-27124-19F9A815; Wed, 08 May 2013 18:55:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1368039305!31239493!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10872 invoked from network); 8 May 2013 18:55:12 -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;
	8 May 2013 18: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 1Ua9W4-0006Qr-Qu
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9W4-0000jK-JT
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:04 +0000
Date: Wed, 08 May 2013 18:55:04 +0000
Message-Id: <E1Ua9W4-0000jK-JT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: trap guest WFI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a780f750d7fc35ec23b7771516fe11a390d0aa07
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 1 11:32:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:01:45 2013 +0100

    xen/arm: trap guest WFI
    
    Trap guest WFI, block the guest VCPU unless it has pending interrupts
    (WFI should return if any interrupts arrive even if interrupts are
    disabled).
    
    Awake the guest vcpu when a new interrupt for it arrives.
    
    Introduce gic_events_need_delivery: it checks whether the current vcpu
    has any interrupts that need to be delivered either on the lrs or in
    lr_pending.
    
    Properly implement local_events_need_delivery: check if the guest
    disabled interrupts, if they aren't disabled, return positive if
    gic_events_need_delivery returns positive. Otherwise we still need to
    check whether evtchn_upcall_pending is set but no
    VGIC_IRQ_EVTCHN_CALLBACK irqs are in flight: it could be the race
    described by commit db453468d92369e7182663fb13e14d83ec4ce456 "arm: vgic:
    fix race between evtchn upcall and evtchnop_send". If that is the case
    it means that an event needs to be injected.
    If all these tests are negative then no events need to be delivered.
    
    Implement local_event_delivery_enable by clearing PSR_IRQ_MASK.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c          |    8 +++++++-
 xen/arch/arm/traps.c        |   17 ++++++++++++++++-
 xen/arch/arm/vgic.c         |    1 +
 xen/include/asm-arm/event.h |   41 ++++++++++++++++++++++++++++++++---------
 xen/include/asm-arm/gic.h   |    1 +
 5 files changed, 57 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index afc9405..8a49e12 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -592,13 +592,19 @@ static void gic_inject_irq_stop(void)
     }
 }
 
+int gic_events_need_delivery(void)
+{
+    return (!list_empty(&current->arch.vgic.lr_pending) ||
+            this_cpu(lr_mask));
+}
+
 void gic_inject(void)
 {
     if ( vcpu_info(current, evtchn_upcall_pending) )
         vgic_vcpu_inject_irq(current, VGIC_IRQ_EVTCHN_CALLBACK, 1);
 
     gic_restore_pending_irqs(current);
-    if (!this_cpu(lr_mask))
+    if (!gic_events_need_delivery())
         gic_inject_irq_stop();
     else
         gic_inject_irq_start();
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index b7487b7..da53675 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -29,7 +29,9 @@
 #include <xen/hypercall.h>
 #include <xen/softirq.h>
 #include <xen/domain_page.h>
+#include <public/sched.h>
 #include <public/xen.h>
+#include <asm/event.h>
 #include <asm/regs.h>
 #include <asm/cpregs.h>
 
@@ -59,7 +61,7 @@ void __cpuinit init_traps(void)
     WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
 
     /* Setup hypervisor traps */
-    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
+    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM|HCR_TWI, HCR_EL2);
     isb();
 }
 
@@ -931,6 +933,19 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
     union hsr hsr = { .bits = READ_SYSREG32(ESR_EL2) };
 
     switch (hsr.ec) {
+    case HSR_EC_WFI_WFE:
+        /* at the moment we only trap WFI */
+        vcpu_block();
+        /* The ARM spec declares that even if local irqs are masked in
+         * the CPSR register, an irq should wake up a cpu from WFI anyway.
+         * For this reason we need to check for irqs that need delivery,
+         * ignoring the CPSR register, *after* calling SCHEDOP_block to
+         * avoid races with vgic_vcpu_inject_irq.
+         */
+        if ( local_events_need_delivery_nomask() )
+            vcpu_unblock(current);
+        regs->pc += hsr.len ? 4 : 2;
+        break;
     case HSR_EC_CP15_32:
         if ( ! is_pv32_domain(current->domain) )
             goto bad_trap;
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index a984621..99e7280 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -618,6 +618,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
     /* we have a new higher priority irq, inject it into the guest */
+    vcpu_unblock(v);
 }
 
 /*
diff --git a/xen/include/asm-arm/event.h b/xen/include/asm-arm/event.h
index 10f58af..ed05901 100644
--- a/xen/include/asm-arm/event.h
+++ b/xen/include/asm-arm/event.h
@@ -1,27 +1,50 @@
 #ifndef __ASM_EVENT_H__
 #define __ASM_EVENT_H__
 
+#include <asm/gic.h>
+#include <asm/domain.h>
+
 void vcpu_kick(struct vcpu *v);
 void vcpu_mark_events_pending(struct vcpu *v);
 
+static inline int local_events_need_delivery_nomask(void)
+{
+    struct pending_irq *p = irq_to_pending(current, VGIC_IRQ_EVTCHN_CALLBACK);
+
+    /* XXX: if the first interrupt has already been delivered, we should
+     * check whether any other interrupts with priority higher than the
+     * one in GICV_IAR are in the lr_pending queue or in the LR
+     * registers and return 1 only in that case.
+     * In practice the guest interrupt handler should run with
+     * interrupts disabled so this shouldn't be a problem in the general
+     * case.
+     */
+    if ( gic_events_need_delivery() )
+        return 1;
+
+    if ( vcpu_info(current, evtchn_upcall_pending) &&
+        list_empty(&p->inflight) )
+        return 1;
+
+    return 0;
+}
+
 static inline int local_events_need_delivery(void)
 {
-    /* TODO
-     * return (vcpu_info(v, evtchn_upcall_pending) &&
-                        !vcpu_info(v, evtchn_upcall_mask)); */
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+
+    /* guest IRQs are masked */
+    if ( (regs->cpsr & PSR_IRQ_MASK) )
         return 0;
+    return local_events_need_delivery_nomask();
 }
 
 int local_event_delivery_is_enabled(void);
 
-static inline void local_event_delivery_disable(void)
-{
-    /* TODO current->vcpu_info->evtchn_upcall_mask = 1; */
-}
-
 static inline void local_event_delivery_enable(void)
 {
-    /* TODO current->vcpu_info->evtchn_upcall_mask = 0; */
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+    regs->cpsr &= ~PSR_IRQ_MASK;
 }
 
 /* No arch specific virq definition now. Default to global. */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 24c0d5c..92711d5 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -143,6 +143,7 @@ extern void gic_route_ppis(void);
 extern void gic_route_spis(void);
 
 extern void gic_inject(void);
+extern int gic_events_need_delivery(void);
 
 extern void __cpuinit init_maintenance_interrupt(void);
 extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18: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 1Ua9WF-0005gj-TV; Wed, 08 May 2013 18:55:15 +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 1Ua9WE-0005ge-7u
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:14 +0000
Received: from [85.158.143.99:26581] by server-2.bemta-4.messagelabs.com id
	F9/FD-27124-19F9A815; Wed, 08 May 2013 18:55:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1368039305!31239493!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10872 invoked from network); 8 May 2013 18:55:12 -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;
	8 May 2013 18: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 1Ua9W4-0006Qr-Qu
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9W4-0000jK-JT
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:04 +0000
Date: Wed, 08 May 2013 18:55:04 +0000
Message-Id: <E1Ua9W4-0000jK-JT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: trap guest WFI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a780f750d7fc35ec23b7771516fe11a390d0aa07
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 1 11:32:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:01:45 2013 +0100

    xen/arm: trap guest WFI
    
    Trap guest WFI, block the guest VCPU unless it has pending interrupts
    (WFI should return if any interrupts arrive even if interrupts are
    disabled).
    
    Awake the guest vcpu when a new interrupt for it arrives.
    
    Introduce gic_events_need_delivery: it checks whether the current vcpu
    has any interrupts that need to be delivered either on the lrs or in
    lr_pending.
    
    Properly implement local_events_need_delivery: check if the guest
    disabled interrupts, if they aren't disabled, return positive if
    gic_events_need_delivery returns positive. Otherwise we still need to
    check whether evtchn_upcall_pending is set but no
    VGIC_IRQ_EVTCHN_CALLBACK irqs are in flight: it could be the race
    described by commit db453468d92369e7182663fb13e14d83ec4ce456 "arm: vgic:
    fix race between evtchn upcall and evtchnop_send". If that is the case
    it means that an event needs to be injected.
    If all these tests are negative then no events need to be delivered.
    
    Implement local_event_delivery_enable by clearing PSR_IRQ_MASK.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c          |    8 +++++++-
 xen/arch/arm/traps.c        |   17 ++++++++++++++++-
 xen/arch/arm/vgic.c         |    1 +
 xen/include/asm-arm/event.h |   41 ++++++++++++++++++++++++++++++++---------
 xen/include/asm-arm/gic.h   |    1 +
 5 files changed, 57 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index afc9405..8a49e12 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -592,13 +592,19 @@ static void gic_inject_irq_stop(void)
     }
 }
 
+int gic_events_need_delivery(void)
+{
+    return (!list_empty(&current->arch.vgic.lr_pending) ||
+            this_cpu(lr_mask));
+}
+
 void gic_inject(void)
 {
     if ( vcpu_info(current, evtchn_upcall_pending) )
         vgic_vcpu_inject_irq(current, VGIC_IRQ_EVTCHN_CALLBACK, 1);
 
     gic_restore_pending_irqs(current);
-    if (!this_cpu(lr_mask))
+    if (!gic_events_need_delivery())
         gic_inject_irq_stop();
     else
         gic_inject_irq_start();
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index b7487b7..da53675 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -29,7 +29,9 @@
 #include <xen/hypercall.h>
 #include <xen/softirq.h>
 #include <xen/domain_page.h>
+#include <public/sched.h>
 #include <public/xen.h>
+#include <asm/event.h>
 #include <asm/regs.h>
 #include <asm/cpregs.h>
 
@@ -59,7 +61,7 @@ void __cpuinit init_traps(void)
     WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
 
     /* Setup hypervisor traps */
-    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
+    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM|HCR_TWI, HCR_EL2);
     isb();
 }
 
@@ -931,6 +933,19 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
     union hsr hsr = { .bits = READ_SYSREG32(ESR_EL2) };
 
     switch (hsr.ec) {
+    case HSR_EC_WFI_WFE:
+        /* at the moment we only trap WFI */
+        vcpu_block();
+        /* The ARM spec declares that even if local irqs are masked in
+         * the CPSR register, an irq should wake up a cpu from WFI anyway.
+         * For this reason we need to check for irqs that need delivery,
+         * ignoring the CPSR register, *after* calling SCHEDOP_block to
+         * avoid races with vgic_vcpu_inject_irq.
+         */
+        if ( local_events_need_delivery_nomask() )
+            vcpu_unblock(current);
+        regs->pc += hsr.len ? 4 : 2;
+        break;
     case HSR_EC_CP15_32:
         if ( ! is_pv32_domain(current->domain) )
             goto bad_trap;
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index a984621..99e7280 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -618,6 +618,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
     /* we have a new higher priority irq, inject it into the guest */
+    vcpu_unblock(v);
 }
 
 /*
diff --git a/xen/include/asm-arm/event.h b/xen/include/asm-arm/event.h
index 10f58af..ed05901 100644
--- a/xen/include/asm-arm/event.h
+++ b/xen/include/asm-arm/event.h
@@ -1,27 +1,50 @@
 #ifndef __ASM_EVENT_H__
 #define __ASM_EVENT_H__
 
+#include <asm/gic.h>
+#include <asm/domain.h>
+
 void vcpu_kick(struct vcpu *v);
 void vcpu_mark_events_pending(struct vcpu *v);
 
+static inline int local_events_need_delivery_nomask(void)
+{
+    struct pending_irq *p = irq_to_pending(current, VGIC_IRQ_EVTCHN_CALLBACK);
+
+    /* XXX: if the first interrupt has already been delivered, we should
+     * check whether any other interrupts with priority higher than the
+     * one in GICV_IAR are in the lr_pending queue or in the LR
+     * registers and return 1 only in that case.
+     * In practice the guest interrupt handler should run with
+     * interrupts disabled so this shouldn't be a problem in the general
+     * case.
+     */
+    if ( gic_events_need_delivery() )
+        return 1;
+
+    if ( vcpu_info(current, evtchn_upcall_pending) &&
+        list_empty(&p->inflight) )
+        return 1;
+
+    return 0;
+}
+
 static inline int local_events_need_delivery(void)
 {
-    /* TODO
-     * return (vcpu_info(v, evtchn_upcall_pending) &&
-                        !vcpu_info(v, evtchn_upcall_mask)); */
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+
+    /* guest IRQs are masked */
+    if ( (regs->cpsr & PSR_IRQ_MASK) )
         return 0;
+    return local_events_need_delivery_nomask();
 }
 
 int local_event_delivery_is_enabled(void);
 
-static inline void local_event_delivery_disable(void)
-{
-    /* TODO current->vcpu_info->evtchn_upcall_mask = 1; */
-}
-
 static inline void local_event_delivery_enable(void)
 {
-    /* TODO current->vcpu_info->evtchn_upcall_mask = 0; */
+    struct cpu_user_regs *regs = guest_cpu_user_regs();
+    regs->cpsr &= ~PSR_IRQ_MASK;
 }
 
 /* No arch specific virq definition now. Default to global. */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 24c0d5c..92711d5 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -143,6 +143,7 @@ extern void gic_route_ppis(void);
 extern void gic_route_spis(void);
 
 extern void gic_inject(void);
+extern int gic_events_need_delivery(void);
 
 extern void __cpuinit init_maintenance_interrupt(void);
 extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9WJ-0005gu-0P; Wed, 08 May 2013 18:55:19 +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 1Ua9WH-0005ge-Hw
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:17 +0000
Received: from [85.158.143.99:26712] by server-2.bemta-4.messagelabs.com id
	5F/FD-27124-59F9A815; Wed, 08 May 2013 18:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1368039315!29656670!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28066 invoked from network); 8 May 2013 18:55:16 -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;
	8 May 2013 18:55: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 1Ua9WF-0006Qu-16
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9WE-0000ji-VF
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:14 +0000
Date: Wed, 08 May 2013 18:55:14 +0000
Message-Id: <E1Ua9WE-0000ji-VF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: trap SMC instructions and
	inject an UND 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 64839b0f295dfa18ffde1b05da03bc0ff1dabd58
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue May 7 15:12:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:01:49 2013 +0100

    xen/arm: trap SMC instructions and inject an UND exception
    
    Currently only handles 32 bit guests. The 64-bit exception model is
    considerably different.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/traps.c                  |   56 ++++++++++++++++++++++++++++++++-
 xen/include/asm-arm/arm32/processor.h |    4 ++-
 xen/include/asm-arm/processor.h       |    8 +++++
 xen/include/public/arch-arm.h         |    1 +
 4 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index da53675..55cbb90 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -61,7 +61,7 @@ void __cpuinit init_traps(void)
     WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
 
     /* Setup hypervisor traps */
-    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM|HCR_TWI, HCR_EL2);
+    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM|HCR_TWI|HCR_TSC, HCR_EL2);
     isb();
 }
 
@@ -241,6 +241,54 @@ void panic_PAR(uint64_t par)
     panic("Error during Hypervisor-to-physical address translation\n");
 }
 
+static void cpsr_switch_mode(struct cpu_user_regs *regs, int mode)
+{
+    uint32_t sctlr = READ_SYSREG32(SCTLR_EL1);
+
+    regs->cpsr &= ~(PSR_MODE_MASK|PSR_IT_MASK|PSR_JAZELLE|PSR_BIG_ENDIAN|PSR_THUMB);
+
+    regs->cpsr |= mode;
+    regs->cpsr |= PSR_IRQ_MASK;
+    if (sctlr & SCTLR_TE)
+        regs->cpsr |= PSR_THUMB;
+    if (sctlr & SCTLR_EE)
+        regs->cpsr |= PSR_BIG_ENDIAN;
+}
+
+static vaddr_t exception_handler(vaddr_t offset)
+{
+    uint32_t sctlr = READ_SYSREG32(SCTLR_EL1);
+
+    if (sctlr & SCTLR_V)
+        return 0xffff0000 + offset;
+    else /* always have security exceptions */
+        return READ_SYSREG(VBAR_EL1) + offset;
+}
+
+/* Injects an Undefined Instruction exception into the current vcpu,
+ * PC is the exact address of the faulting instruction (without
+ * pipeline adjustments). See TakeUndefInstrException pseudocode in
+ * ARM.
+ */
+static void inject_undef_exception(struct cpu_user_regs *regs,
+                                   register_t preferred_return)
+{
+    uint32_t spsr = regs->cpsr;
+    int is_thumb = (regs->cpsr & PSR_THUMB);
+    /* Saved PC points to the instruction past the faulting instruction. */
+    uint32_t return_offset = is_thumb ? 2 : 4;
+
+    /* Update processor mode */
+    cpsr_switch_mode(regs, PSR_MODE_UND);
+
+    /* Update banked registers */
+    regs->spsr_und = spsr;
+    regs->lr_und = preferred_return + return_offset;
+
+    /* Branch to exception vector */
+    regs->pc32 = exception_handler(VECTOR32_UND);
+}
+
 struct reg_ctxt {
     uint32_t sctlr, tcr;
     uint64_t ttbr0, ttbr1;
@@ -956,6 +1004,12 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
             goto bad_trap;
         do_cp15_64(regs, hsr);
         break;
+    case HSR_EC_SMC:
+        /* PC32 already contains the preferred exception return
+         * address, so no need to adjust here.
+         */
+        inject_undef_exception(regs, regs->pc32);
+        break;
     case HSR_EC_HVC:
         if ( (hsr.iss & 0xff00) == 0xff00 )
             return do_debug_trap(regs, hsr.iss & 0x00ff);
diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h
index cd79170..d26fc85 100644
--- a/xen/include/asm-arm/arm32/processor.h
+++ b/xen/include/asm-arm/arm32/processor.h
@@ -31,7 +31,9 @@ struct cpu_user_regs
         uint32_t lr_usr;
     };
 
-    uint32_t pc; /* Return IP */
+    union {  /* Return IP, pc32 is used to allow code to be common with 64-bit */
+        uint32_t pc, pc32;
+    };
     uint32_t cpsr; /* Return mode */
     uint32_t pad0; /* Doubleword-align the kernel half of the frame */
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 1681ebf..1c9d793 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -85,6 +85,7 @@
 #define HSR_EC_CP14_64              0x0c
 #define HSR_EC_SVC                  0x11
 #define HSR_EC_HVC                  0x12
+#define HSR_EC_SMC                  0x13
 #define HSR_EC_INSTR_ABORT_GUEST    0x20
 #define HSR_EC_INSTR_ABORT_HYP      0x21
 #define HSR_EC_DATA_ABORT_GUEST     0x24
@@ -342,6 +343,13 @@ union hsr {
 #define CNTx_CTL_MASK     (1u<<1)  /* Mask IRQ */
 #define CNTx_CTL_PENDING  (1u<<2)  /* IRQ pending */
 
+/* Exception Vector offsets */
+#define VECTOR32_RST  0
+#define VECTOR32_UND  4
+#define VECTOR32_SVC  8
+#define VECTOR32_PABT 12
+#define VECTOR32_DABT 16
+
 #if defined(CONFIG_ARM_32)
 # include <asm/arm32/processor.h>
 #elif defined(CONFIG_ARM_64)
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 2f5ce18..cea12b2 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -234,6 +234,7 @@ typedef uint64_t xen_callback_t;
 #define PSR_IRQ_MASK    (1<<7)        /* Interrupt mask */
 #define PSR_ABT_MASK    (1<<8)        /* Asynchronous Abort mask */
 #define PSR_BIG_ENDIAN  (1<<9)        /* Big Endian Mode */
+#define PSR_IT_MASK     (0x0600fc00)  /* Thumb If-Then Mask */
 #define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */
 
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9WJ-0005gu-0P; Wed, 08 May 2013 18:55:19 +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 1Ua9WH-0005ge-Hw
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:17 +0000
Received: from [85.158.143.99:26712] by server-2.bemta-4.messagelabs.com id
	5F/FD-27124-59F9A815; Wed, 08 May 2013 18:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1368039315!29656670!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28066 invoked from network); 8 May 2013 18:55:16 -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;
	8 May 2013 18:55: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 1Ua9WF-0006Qu-16
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9WE-0000ji-VF
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:14 +0000
Date: Wed, 08 May 2013 18:55:14 +0000
Message-Id: <E1Ua9WE-0000ji-VF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: trap SMC instructions and
	inject an UND 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 64839b0f295dfa18ffde1b05da03bc0ff1dabd58
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue May 7 15:12:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:01:49 2013 +0100

    xen/arm: trap SMC instructions and inject an UND exception
    
    Currently only handles 32 bit guests. The 64-bit exception model is
    considerably different.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/traps.c                  |   56 ++++++++++++++++++++++++++++++++-
 xen/include/asm-arm/arm32/processor.h |    4 ++-
 xen/include/asm-arm/processor.h       |    8 +++++
 xen/include/public/arch-arm.h         |    1 +
 4 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index da53675..55cbb90 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -61,7 +61,7 @@ void __cpuinit init_traps(void)
     WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
 
     /* Setup hypervisor traps */
-    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM|HCR_TWI, HCR_EL2);
+    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM|HCR_TWI|HCR_TSC, HCR_EL2);
     isb();
 }
 
@@ -241,6 +241,54 @@ void panic_PAR(uint64_t par)
     panic("Error during Hypervisor-to-physical address translation\n");
 }
 
+static void cpsr_switch_mode(struct cpu_user_regs *regs, int mode)
+{
+    uint32_t sctlr = READ_SYSREG32(SCTLR_EL1);
+
+    regs->cpsr &= ~(PSR_MODE_MASK|PSR_IT_MASK|PSR_JAZELLE|PSR_BIG_ENDIAN|PSR_THUMB);
+
+    regs->cpsr |= mode;
+    regs->cpsr |= PSR_IRQ_MASK;
+    if (sctlr & SCTLR_TE)
+        regs->cpsr |= PSR_THUMB;
+    if (sctlr & SCTLR_EE)
+        regs->cpsr |= PSR_BIG_ENDIAN;
+}
+
+static vaddr_t exception_handler(vaddr_t offset)
+{
+    uint32_t sctlr = READ_SYSREG32(SCTLR_EL1);
+
+    if (sctlr & SCTLR_V)
+        return 0xffff0000 + offset;
+    else /* always have security exceptions */
+        return READ_SYSREG(VBAR_EL1) + offset;
+}
+
+/* Injects an Undefined Instruction exception into the current vcpu,
+ * PC is the exact address of the faulting instruction (without
+ * pipeline adjustments). See TakeUndefInstrException pseudocode in
+ * ARM.
+ */
+static void inject_undef_exception(struct cpu_user_regs *regs,
+                                   register_t preferred_return)
+{
+    uint32_t spsr = regs->cpsr;
+    int is_thumb = (regs->cpsr & PSR_THUMB);
+    /* Saved PC points to the instruction past the faulting instruction. */
+    uint32_t return_offset = is_thumb ? 2 : 4;
+
+    /* Update processor mode */
+    cpsr_switch_mode(regs, PSR_MODE_UND);
+
+    /* Update banked registers */
+    regs->spsr_und = spsr;
+    regs->lr_und = preferred_return + return_offset;
+
+    /* Branch to exception vector */
+    regs->pc32 = exception_handler(VECTOR32_UND);
+}
+
 struct reg_ctxt {
     uint32_t sctlr, tcr;
     uint64_t ttbr0, ttbr1;
@@ -956,6 +1004,12 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
             goto bad_trap;
         do_cp15_64(regs, hsr);
         break;
+    case HSR_EC_SMC:
+        /* PC32 already contains the preferred exception return
+         * address, so no need to adjust here.
+         */
+        inject_undef_exception(regs, regs->pc32);
+        break;
     case HSR_EC_HVC:
         if ( (hsr.iss & 0xff00) == 0xff00 )
             return do_debug_trap(regs, hsr.iss & 0x00ff);
diff --git a/xen/include/asm-arm/arm32/processor.h b/xen/include/asm-arm/arm32/processor.h
index cd79170..d26fc85 100644
--- a/xen/include/asm-arm/arm32/processor.h
+++ b/xen/include/asm-arm/arm32/processor.h
@@ -31,7 +31,9 @@ struct cpu_user_regs
         uint32_t lr_usr;
     };
 
-    uint32_t pc; /* Return IP */
+    union {  /* Return IP, pc32 is used to allow code to be common with 64-bit */
+        uint32_t pc, pc32;
+    };
     uint32_t cpsr; /* Return mode */
     uint32_t pad0; /* Doubleword-align the kernel half of the frame */
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 1681ebf..1c9d793 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -85,6 +85,7 @@
 #define HSR_EC_CP14_64              0x0c
 #define HSR_EC_SVC                  0x11
 #define HSR_EC_HVC                  0x12
+#define HSR_EC_SMC                  0x13
 #define HSR_EC_INSTR_ABORT_GUEST    0x20
 #define HSR_EC_INSTR_ABORT_HYP      0x21
 #define HSR_EC_DATA_ABORT_GUEST     0x24
@@ -342,6 +343,13 @@ union hsr {
 #define CNTx_CTL_MASK     (1u<<1)  /* Mask IRQ */
 #define CNTx_CTL_PENDING  (1u<<2)  /* IRQ pending */
 
+/* Exception Vector offsets */
+#define VECTOR32_RST  0
+#define VECTOR32_UND  4
+#define VECTOR32_SVC  8
+#define VECTOR32_PABT 12
+#define VECTOR32_DABT 16
+
 #if defined(CONFIG_ARM_32)
 # include <asm/arm32/processor.h>
 #elif defined(CONFIG_ARM_64)
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 2f5ce18..cea12b2 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -234,6 +234,7 @@ typedef uint64_t xen_callback_t;
 #define PSR_IRQ_MASK    (1<<7)        /* Interrupt mask */
 #define PSR_ABT_MASK    (1<<8)        /* Asynchronous Abort mask */
 #define PSR_BIG_ENDIAN  (1<<9)        /* Big Endian Mode */
+#define PSR_IT_MASK     (0x0600fc00)  /* Thumb If-Then Mask */
 #define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */
 
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9WV-0005iC-3V; Wed, 08 May 2013 18:55: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 1Ua9WT-0005hz-Ol
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:30 +0000
Received: from [85.158.137.99:4144] by server-14.bemta-3.messagelabs.com id
	47/1C-20016-0AF9A815; Wed, 08 May 2013 18:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1368039326!15645181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24147 invoked from network); 8 May 2013 18:55:27 -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;
	8 May 2013 18:55: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 1Ua9WP-0006Qy-9y
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9WP-0000k4-7u
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:25 +0000
Date: Wed, 08 May 2013 18:55:25 +0000
Message-Id: <E1Ua9WP-0000k4-7u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: basic PSCI support,
	implement cpu_on and cpu_off
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 51c2a919a33610d8f67788af12cf647c766685e2
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:38 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:01:52 2013 +0100

    xen/arm: basic PSCI support, implement cpu_on and cpu_off
    
    Implement support for ARM Power State Coordination Interface, PSCI in
    short. Support only HVC calls.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile         |    1 +
 xen/arch/arm/domain_build.c   |    2 +-
 xen/arch/arm/psci.c           |   76 +++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/traps.c          |   45 ++++++++++++++++++++++++
 xen/include/asm-arm/psci.h    |   24 +++++++++++++
 xen/include/public/arch-arm.h |    2 +
 6 files changed, 149 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 2106a4f..8f75044 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -5,6 +5,7 @@ subdir-y += platforms
 obj-y += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
+obj-y += psci.o
 obj-y += domctl.o
 obj-y += sysctl.o
 obj-y += domain_build.o
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 17aadcf..1b2a4fa 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -419,7 +419,7 @@ int construct_dom0(struct domain *d)
 
     regs->pc = (uint32_t)kinfo.entry;
 
-    regs->cpsr = PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC;
+    regs->cpsr = PSR_GUEST_INIT;
 
 #ifdef CONFIG_ARM_64
     d->arch.type = kinfo.type;
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
new file mode 100644
index 0000000..1761791
--- /dev/null
+++ b/xen/arch/arm/psci.c
@@ -0,0 +1,76 @@
+/*
+ * 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 <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/types.h>
+
+#include <asm/current.h>
+#include <asm/psci.h>
+
+int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
+{
+    struct vcpu *v;
+    struct domain *d = current->domain;
+    struct vcpu_guest_context *ctxt;
+    int rc;
+
+    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
+        return PSCI_EINVAL;
+
+    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+        return PSCI_EINVAL;
+
+    if ( (ctxt = alloc_vcpu_guest_context()) == NULL )
+        return PSCI_DENIED;
+
+    memset(ctxt, 0, sizeof(*ctxt));
+    ctxt->user_regs.pc64 = (u64) entry_point;
+    ctxt->sctlr = SCTLR_BASE;
+    ctxt->ttbr0 = 0;
+    ctxt->ttbr1 = 0;
+    ctxt->ttbcr = 0; /* Defined Reset Value */
+    ctxt->user_regs.cpsr = PSR_GUEST_INIT;
+    ctxt->flags = VGCF_online;
+
+    domain_lock(d);
+    rc = arch_set_info_guest(v, ctxt);
+    free_vcpu_guest_context(ctxt);
+
+    if ( rc < 0 )
+    {
+        domain_unlock(d);
+        return PSCI_DENIED;
+    }
+    domain_unlock(d);
+
+    vcpu_wake(v);
+
+    return PSCI_SUCCESS;
+}
+
+int do_psci_cpu_off(uint32_t power_state)
+{
+    struct vcpu *v = current;
+    if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )
+        vcpu_sleep_nosync(v);
+    return PSCI_SUCCESS;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 55cbb90..c743f2c 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -34,6 +34,7 @@
 #include <asm/event.h>
 #include <asm/regs.h>
 #include <asm/cpregs.h>
+#include <asm/psci.h>
 
 #include "io.h"
 #include "vtimer.h"
@@ -666,6 +667,29 @@ static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(grant_table_op, 3),
 };
 
+#define __PSCI_cpu_suspend 0
+#define __PSCI_cpu_off     1
+#define __PSCI_cpu_on      2
+#define __PSCI_migrate     3
+
+typedef int (*arm_psci_fn_t)(uint32_t, register_t);
+
+typedef struct {
+    arm_psci_fn_t fn;
+    int nr_args;
+} arm_psci_t;
+
+#define PSCI(_name, _nr_args)                                  \
+    [ __PSCI_ ## _name ] =  {                                  \
+        .fn = (arm_psci_fn_t) &do_psci_ ## _name,              \
+        .nr_args = _nr_args,                                   \
+    }
+
+static arm_psci_t arm_psci_table[] = {
+    PSCI(cpu_off, 1),
+    PSCI(cpu_on, 2),
+};
+
 static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
 {
     register_t *r;
@@ -695,6 +719,25 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
     }
 }
 
+static void do_trap_psci(struct cpu_user_regs *regs)
+{
+    arm_psci_fn_t psci_call = NULL;
+
+    if ( regs->r0 >= ARRAY_SIZE(arm_psci_table) )
+    {
+        domain_crash_synchronous();
+        return;
+    }
+
+    psci_call = arm_psci_table[regs->r0].fn;
+    if ( psci_call == NULL )
+    {
+        domain_crash_synchronous();
+        return;
+    }
+    regs->r0 = psci_call(regs->r1, regs->r2);
+}
+
 static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
 {
     arm_hypercall_fn_t call = NULL;
@@ -1013,6 +1056,8 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
     case HSR_EC_HVC:
         if ( (hsr.iss & 0xff00) == 0xff00 )
             return do_debug_trap(regs, hsr.iss & 0x00ff);
+        if ( hsr.iss == 0 )
+            return do_trap_psci(regs);
         do_trap_hypercall(regs, hsr.iss);
         break;
     case HSR_EC_DATA_ABORT_GUEST:
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
new file mode 100644
index 0000000..67d4c35
--- /dev/null
+++ b/xen/include/asm-arm/psci.h
@@ -0,0 +1,24 @@
+#ifndef __ASM_PSCI_H__
+#define __ASM_PSCI_H__
+
+#define PSCI_SUCCESS  0
+#define PSCI_ENOSYS  -1
+#define PSCI_EINVAL  -2
+#define PSCI_DENIED  -3
+
+int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
+int do_psci_cpu_off(uint32_t power_state);
+int do_psci_cpu_suspend(uint32_t power_state, register_t entry_point);
+int do_psci_migrate(uint32_t vcpuid);
+
+#endif /* __ASM_PSCI_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index cea12b2..8aa62d3 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -237,6 +237,8 @@ typedef uint64_t xen_callback_t;
 #define PSR_IT_MASK     (0x0600fc00)  /* Thumb If-Then Mask */
 #define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */
 
+#define PSR_GUEST_INIT  (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC)
+
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9WV-0005iC-3V; Wed, 08 May 2013 18:55: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 1Ua9WT-0005hz-Ol
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:30 +0000
Received: from [85.158.137.99:4144] by server-14.bemta-3.messagelabs.com id
	47/1C-20016-0AF9A815; Wed, 08 May 2013 18:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1368039326!15645181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24147 invoked from network); 8 May 2013 18:55:27 -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;
	8 May 2013 18:55: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 1Ua9WP-0006Qy-9y
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9WP-0000k4-7u
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:25 +0000
Date: Wed, 08 May 2013 18:55:25 +0000
Message-Id: <E1Ua9WP-0000k4-7u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: basic PSCI support,
	implement cpu_on and cpu_off
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 51c2a919a33610d8f67788af12cf647c766685e2
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:38 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:01:52 2013 +0100

    xen/arm: basic PSCI support, implement cpu_on and cpu_off
    
    Implement support for ARM Power State Coordination Interface, PSCI in
    short. Support only HVC calls.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile         |    1 +
 xen/arch/arm/domain_build.c   |    2 +-
 xen/arch/arm/psci.c           |   76 +++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/traps.c          |   45 ++++++++++++++++++++++++
 xen/include/asm-arm/psci.h    |   24 +++++++++++++
 xen/include/public/arch-arm.h |    2 +
 6 files changed, 149 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 2106a4f..8f75044 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -5,6 +5,7 @@ subdir-y += platforms
 obj-y += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
+obj-y += psci.o
 obj-y += domctl.o
 obj-y += sysctl.o
 obj-y += domain_build.o
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 17aadcf..1b2a4fa 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -419,7 +419,7 @@ int construct_dom0(struct domain *d)
 
     regs->pc = (uint32_t)kinfo.entry;
 
-    regs->cpsr = PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC;
+    regs->cpsr = PSR_GUEST_INIT;
 
 #ifdef CONFIG_ARM_64
     d->arch.type = kinfo.type;
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
new file mode 100644
index 0000000..1761791
--- /dev/null
+++ b/xen/arch/arm/psci.c
@@ -0,0 +1,76 @@
+/*
+ * 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 <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/types.h>
+
+#include <asm/current.h>
+#include <asm/psci.h>
+
+int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
+{
+    struct vcpu *v;
+    struct domain *d = current->domain;
+    struct vcpu_guest_context *ctxt;
+    int rc;
+
+    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
+        return PSCI_EINVAL;
+
+    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+        return PSCI_EINVAL;
+
+    if ( (ctxt = alloc_vcpu_guest_context()) == NULL )
+        return PSCI_DENIED;
+
+    memset(ctxt, 0, sizeof(*ctxt));
+    ctxt->user_regs.pc64 = (u64) entry_point;
+    ctxt->sctlr = SCTLR_BASE;
+    ctxt->ttbr0 = 0;
+    ctxt->ttbr1 = 0;
+    ctxt->ttbcr = 0; /* Defined Reset Value */
+    ctxt->user_regs.cpsr = PSR_GUEST_INIT;
+    ctxt->flags = VGCF_online;
+
+    domain_lock(d);
+    rc = arch_set_info_guest(v, ctxt);
+    free_vcpu_guest_context(ctxt);
+
+    if ( rc < 0 )
+    {
+        domain_unlock(d);
+        return PSCI_DENIED;
+    }
+    domain_unlock(d);
+
+    vcpu_wake(v);
+
+    return PSCI_SUCCESS;
+}
+
+int do_psci_cpu_off(uint32_t power_state)
+{
+    struct vcpu *v = current;
+    if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )
+        vcpu_sleep_nosync(v);
+    return PSCI_SUCCESS;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 55cbb90..c743f2c 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -34,6 +34,7 @@
 #include <asm/event.h>
 #include <asm/regs.h>
 #include <asm/cpregs.h>
+#include <asm/psci.h>
 
 #include "io.h"
 #include "vtimer.h"
@@ -666,6 +667,29 @@ static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(grant_table_op, 3),
 };
 
+#define __PSCI_cpu_suspend 0
+#define __PSCI_cpu_off     1
+#define __PSCI_cpu_on      2
+#define __PSCI_migrate     3
+
+typedef int (*arm_psci_fn_t)(uint32_t, register_t);
+
+typedef struct {
+    arm_psci_fn_t fn;
+    int nr_args;
+} arm_psci_t;
+
+#define PSCI(_name, _nr_args)                                  \
+    [ __PSCI_ ## _name ] =  {                                  \
+        .fn = (arm_psci_fn_t) &do_psci_ ## _name,              \
+        .nr_args = _nr_args,                                   \
+    }
+
+static arm_psci_t arm_psci_table[] = {
+    PSCI(cpu_off, 1),
+    PSCI(cpu_on, 2),
+};
+
 static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
 {
     register_t *r;
@@ -695,6 +719,25 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
     }
 }
 
+static void do_trap_psci(struct cpu_user_regs *regs)
+{
+    arm_psci_fn_t psci_call = NULL;
+
+    if ( regs->r0 >= ARRAY_SIZE(arm_psci_table) )
+    {
+        domain_crash_synchronous();
+        return;
+    }
+
+    psci_call = arm_psci_table[regs->r0].fn;
+    if ( psci_call == NULL )
+    {
+        domain_crash_synchronous();
+        return;
+    }
+    regs->r0 = psci_call(regs->r1, regs->r2);
+}
+
 static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
 {
     arm_hypercall_fn_t call = NULL;
@@ -1013,6 +1056,8 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
     case HSR_EC_HVC:
         if ( (hsr.iss & 0xff00) == 0xff00 )
             return do_debug_trap(regs, hsr.iss & 0x00ff);
+        if ( hsr.iss == 0 )
+            return do_trap_psci(regs);
         do_trap_hypercall(regs, hsr.iss);
         break;
     case HSR_EC_DATA_ABORT_GUEST:
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
new file mode 100644
index 0000000..67d4c35
--- /dev/null
+++ b/xen/include/asm-arm/psci.h
@@ -0,0 +1,24 @@
+#ifndef __ASM_PSCI_H__
+#define __ASM_PSCI_H__
+
+#define PSCI_SUCCESS  0
+#define PSCI_ENOSYS  -1
+#define PSCI_EINVAL  -2
+#define PSCI_DENIED  -3
+
+int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
+int do_psci_cpu_off(uint32_t power_state);
+int do_psci_cpu_suspend(uint32_t power_state, register_t entry_point);
+int do_psci_migrate(uint32_t vcpuid);
+
+#endif /* __ASM_PSCI_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index cea12b2..8aa62d3 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -237,6 +237,8 @@ typedef uint64_t xen_callback_t;
 #define PSR_IT_MASK     (0x0600fc00)  /* Thumb If-Then Mask */
 #define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */
 
+#define PSR_GUEST_INIT  (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC)
+
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9Wf-0005ja-6s; Wed, 08 May 2013 18:55:41 +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 1Ua9Wd-0005jL-RH
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:39 +0000
Received: from [193.109.254.147:44603] by server-16.bemta-14.messagelabs.com
	id DD/84-10369-BAF9A815; Wed, 08 May 2013 18:55:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368039335!8494718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25829 invoked from network); 8 May 2013 18:55: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;
	8 May 2013 18:55: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 1Ua9WZ-0006R8-G5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9WZ-0000l1-E7
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:35 +0000
Date: Wed, 08 May 2013 18:55:35 +0000
Message-Id: <E1Ua9WZ-0000l1-E7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: allocate secondaries dom0
	vcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6b0e8e43348a6b5548224ae8edc4907a60bf14d1
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:39 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:01 2013 +0100

    xen/arm: allocate secondaries dom0 vcpus
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 1b2a4fa..8748272 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -363,7 +363,7 @@ static void dtb_load(struct kernel_info *kinfo)
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
-    int rc;
+    int rc, i, cpu;
 
     struct vcpu *v = d->vcpu[0];
     struct cpu_user_regs *regs = &v->arch.cpu_info->guest_cpu_user_regs;
@@ -452,6 +452,16 @@ int construct_dom0(struct domain *d)
     }
 #endif
 
+    for ( i = 1, cpu = 0; i < d->max_vcpus; i++ )
+    {
+        cpu = cpumask_cycle(cpu, &cpu_online_map);
+        if ( alloc_vcpu(d, i, cpu) == NULL )
+        {
+            printk("Failed to allocate dom0 vcpu %d on pcpu %d\n", i, cpu);
+            break;
+        }
+    }
+
     local_abort_enable();
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9Wf-0005ja-6s; Wed, 08 May 2013 18:55:41 +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 1Ua9Wd-0005jL-RH
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:39 +0000
Received: from [193.109.254.147:44603] by server-16.bemta-14.messagelabs.com
	id DD/84-10369-BAF9A815; Wed, 08 May 2013 18:55:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368039335!8494718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25829 invoked from network); 8 May 2013 18:55: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;
	8 May 2013 18:55: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 1Ua9WZ-0006R8-G5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9WZ-0000l1-E7
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:35 +0000
Date: Wed, 08 May 2013 18:55:35 +0000
Message-Id: <E1Ua9WZ-0000l1-E7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: allocate secondaries dom0
	vcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6b0e8e43348a6b5548224ae8edc4907a60bf14d1
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:39 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:01 2013 +0100

    xen/arm: allocate secondaries dom0 vcpus
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 1b2a4fa..8748272 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -363,7 +363,7 @@ static void dtb_load(struct kernel_info *kinfo)
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
-    int rc;
+    int rc, i, cpu;
 
     struct vcpu *v = d->vcpu[0];
     struct cpu_user_regs *regs = &v->arch.cpu_info->guest_cpu_user_regs;
@@ -452,6 +452,16 @@ int construct_dom0(struct domain *d)
     }
 #endif
 
+    for ( i = 1, cpu = 0; i < d->max_vcpus; i++ )
+    {
+        cpu = cpumask_cycle(cpu, &cpu_online_map);
+        if ( alloc_vcpu(d, i, cpu) == NULL )
+        {
+            printk("Failed to allocate dom0 vcpu %d on pcpu %d\n", i, cpu);
+            break;
+        }
+    }
+
     local_abort_enable();
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9Wo-0005km-AP; Wed, 08 May 2013 18:55: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 1Ua9Wm-0005kY-TP
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:49 +0000
Received: from [85.158.139.83:27931] by server-13.bemta-5.messagelabs.com id
	4E/EE-08040-4BF9A815; Wed, 08 May 2013 18:55:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1368039345!28221951!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5929 invoked from network); 8 May 2013 18:55:47 -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;
	8 May 2013 18:55: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 1Ua9Wj-0006RE-Mz
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9Wj-0000lN-L8
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:45 +0000
Date: Wed, 08 May 2013 18:55:45 +0000
Message-Id: <E1Ua9Wj-0000lN-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move for_each_set_bit to
	xen/bitops.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 d1688bd8f94402f61a8d74cac908f05b5f5fbc88
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:09 2013 +0100

    xen: move for_each_set_bit to xen/bitops.h
    
    Move for_each_set_bit from asm-x86/bitops.h to xen/bitops.h.
    Replace #include <asm/bitops.h> with #include <xen/bitops.h> everywhere.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/i8259.c         |    2 +-
 xen/arch/x86/mpparse.c       |    2 +-
 xen/arch/x86/setup.c         |    2 +-
 xen/arch/x86/traps.c         |    2 +-
 xen/include/asm-x86/bitops.h |   11 -----------
 xen/include/asm-x86/smp.h    |    2 +-
 xen/include/asm-x86/system.h |    2 +-
 xen/include/xen/bitops.h     |   11 +++++++++++
 xen/include/xen/event.h      |    2 +-
 xen/include/xen/softirq.h    |    2 +-
 xen/xsm/xsm_policy.c         |    2 +-
 11 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index b537c5f..6fdcce8 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -16,7 +16,7 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/desc.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <xen/delay.h>
 #include <asm/apic.h>
 #include <asm/asm_defns.h>
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 97ab5d3..97d34bc 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -22,7 +22,7 @@
 #include <xen/efi.h>
 #include <xen/sched.h>
 
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/smp.h>
 #include <asm/acpi.h>
 #include <asm/mtrr.h>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index be541cb..8c8b78d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -29,7 +29,7 @@
 #include <public/version.h>
 #include <compat/platform.h>
 #include <compat/xen.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/smp.h>
 #include <asm/processor.h>
 #include <asm/mpspec.h>
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 48fe468..087bbeb 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -52,7 +52,7 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/desc.h>
 #include <asm/debugreg.h>
 #include <asm/smp.h>
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index c3cbd26..f5a84ef 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -368,17 +368,6 @@ static inline unsigned int __scanbit(unsigned long val, unsigned long max)
   __find_next_zero_bit(addr,size,off)))
 
 /**
- * for_each_set_bit - iterate over every set bit in a memory region
- * @bit: The integer iterator
- * @addr: The address to base the search on
- * @size: The maximum size to search
- */
-#define for_each_set_bit(bit, addr, size)               \
-    for ( (bit) = find_first_bit(addr, size);           \
-          (bit) < (size);                               \
-          (bit) = find_next_bit(addr, size, (bit) + 1) )
-
-/**
  * find_first_set_bit - find the first set bit in @word
  * @word: the word to search
  * 
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index 301f8c7..81f8610 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -12,7 +12,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/mpspec.h>
 #endif
 
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index b0876d6..6ab7d56 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -2,7 +2,7 @@
 #define __ASM_SYSTEM_H
 
 #include <xen/lib.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 
 #define read_segment_register(name)                             \
 ({  u16 __sel;                                                  \
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index c6a78b6..6054155 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -182,4 +182,15 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
 #define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
 #define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
 
+/**
+ * for_each_set_bit - iterate over every set bit in a memory region
+ * @bit: The integer iterator
+ * @addr: The address to base the search on
+ * @size: The maximum size to search
+ */
+#define for_each_set_bit(bit, addr, size)               \
+    for ( (bit) = find_first_bit(addr, size);           \
+          (bit) < (size);                               \
+          (bit) = find_next_bit(addr, size, (bit) + 1) )
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 71c3e92..4ac39ad 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -12,7 +12,7 @@
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/event.h>
 
 /*
diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h
index 193351d..0c0d481 100644
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -13,7 +13,7 @@ enum {
 
 #include <xen/lib.h>
 #include <xen/smp.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/current.h>
 #include <asm/hardirq.h>
 #include <asm/softirq.h>
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index 65be61d..cad7964 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -20,7 +20,7 @@
 
 #include <xsm/xsm.h>
 #include <xen/multiboot.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 
 char *__initdata policy_buffer = NULL;
 u32 __initdata policy_size = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:55:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:55: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 1Ua9Wo-0005km-AP; Wed, 08 May 2013 18:55: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 1Ua9Wm-0005kY-TP
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:49 +0000
Received: from [85.158.139.83:27931] by server-13.bemta-5.messagelabs.com id
	4E/EE-08040-4BF9A815; Wed, 08 May 2013 18:55:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1368039345!28221951!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5929 invoked from network); 8 May 2013 18:55:47 -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;
	8 May 2013 18:55: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 1Ua9Wj-0006RE-Mz
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9Wj-0000lN-L8
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:45 +0000
Date: Wed, 08 May 2013 18:55:45 +0000
Message-Id: <E1Ua9Wj-0000lN-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move for_each_set_bit to
	xen/bitops.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 d1688bd8f94402f61a8d74cac908f05b5f5fbc88
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:09 2013 +0100

    xen: move for_each_set_bit to xen/bitops.h
    
    Move for_each_set_bit from asm-x86/bitops.h to xen/bitops.h.
    Replace #include <asm/bitops.h> with #include <xen/bitops.h> everywhere.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/i8259.c         |    2 +-
 xen/arch/x86/mpparse.c       |    2 +-
 xen/arch/x86/setup.c         |    2 +-
 xen/arch/x86/traps.c         |    2 +-
 xen/include/asm-x86/bitops.h |   11 -----------
 xen/include/asm-x86/smp.h    |    2 +-
 xen/include/asm-x86/system.h |    2 +-
 xen/include/xen/bitops.h     |   11 +++++++++++
 xen/include/xen/event.h      |    2 +-
 xen/include/xen/softirq.h    |    2 +-
 xen/xsm/xsm_policy.c         |    2 +-
 11 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index b537c5f..6fdcce8 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -16,7 +16,7 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/desc.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <xen/delay.h>
 #include <asm/apic.h>
 #include <asm/asm_defns.h>
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 97ab5d3..97d34bc 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -22,7 +22,7 @@
 #include <xen/efi.h>
 #include <xen/sched.h>
 
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/smp.h>
 #include <asm/acpi.h>
 #include <asm/mtrr.h>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index be541cb..8c8b78d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -29,7 +29,7 @@
 #include <public/version.h>
 #include <compat/platform.h>
 #include <compat/xen.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/smp.h>
 #include <asm/processor.h>
 #include <asm/mpspec.h>
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 48fe468..087bbeb 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -52,7 +52,7 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/desc.h>
 #include <asm/debugreg.h>
 #include <asm/smp.h>
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index c3cbd26..f5a84ef 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -368,17 +368,6 @@ static inline unsigned int __scanbit(unsigned long val, unsigned long max)
   __find_next_zero_bit(addr,size,off)))
 
 /**
- * for_each_set_bit - iterate over every set bit in a memory region
- * @bit: The integer iterator
- * @addr: The address to base the search on
- * @size: The maximum size to search
- */
-#define for_each_set_bit(bit, addr, size)               \
-    for ( (bit) = find_first_bit(addr, size);           \
-          (bit) < (size);                               \
-          (bit) = find_next_bit(addr, size, (bit) + 1) )
-
-/**
  * find_first_set_bit - find the first set bit in @word
  * @word: the word to search
  * 
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index 301f8c7..81f8610 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -12,7 +12,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/mpspec.h>
 #endif
 
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index b0876d6..6ab7d56 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -2,7 +2,7 @@
 #define __ASM_SYSTEM_H
 
 #include <xen/lib.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 
 #define read_segment_register(name)                             \
 ({  u16 __sel;                                                  \
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index c6a78b6..6054155 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -182,4 +182,15 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
 #define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
 #define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
 
+/**
+ * for_each_set_bit - iterate over every set bit in a memory region
+ * @bit: The integer iterator
+ * @addr: The address to base the search on
+ * @size: The maximum size to search
+ */
+#define for_each_set_bit(bit, addr, size)               \
+    for ( (bit) = find_first_bit(addr, size);           \
+          (bit) < (size);                               \
+          (bit) = find_next_bit(addr, size, (bit) + 1) )
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 71c3e92..4ac39ad 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -12,7 +12,7 @@
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/event.h>
 
 /*
diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h
index 193351d..0c0d481 100644
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -13,7 +13,7 @@ enum {
 
 #include <xen/lib.h>
 #include <xen/smp.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 #include <asm/current.h>
 #include <asm/hardirq.h>
 #include <asm/softirq.h>
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index 65be61d..cad7964 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -20,7 +20,7 @@
 
 #include <xsm/xsm.h>
 #include <xen/multiboot.h>
-#include <asm/bitops.h>
+#include <xen/bitops.h>
 
 char *__initdata policy_buffer = NULL;
 u32 __initdata policy_size = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9Wy-0005mQ-FX; Wed, 08 May 2013 18:56: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 1Ua9Ww-0005m7-Ho
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:58 +0000
Received: from [85.158.139.211:34493] by server-16.bemta-5.messagelabs.com id
	D7/C5-31493-DBF9A815; Wed, 08 May 2013 18:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1368039356!22242620!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11782 invoked from network); 8 May 2013 18:55:57 -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;
	8 May 2013 18:55: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 1Ua9Wt-0006RN-TL
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9Wt-0000lj-R5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:55 +0000
Date: Wed, 08 May 2013 18:55:55 +0000
Message-Id: <E1Ua9Wt-0000lj-R5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support for guest SGI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fbe58dd099cb8f2a86bd7cb0f8db14857ced1a8c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:41 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:15 2013 +0100

    xen/arm: support for guest SGI
    
    Trap writes to GICD_SGIR, parse the requests, inject SGIs into the right
    guest vcpu.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c       |   73 ++++++++++++++++++++++++++++++++++++++++++--
 xen/include/asm-arm/gic.h |   15 +++++----
 2 files changed, 78 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 99e7280..5d242c8 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -17,6 +17,7 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/bitops.h>
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/init.h>
@@ -368,6 +369,71 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     }
 }
 
+static inline int is_vcpu_running(struct domain *d, int vcpuid)
+{
+    struct vcpu *v;
+
+    if ( vcpuid >= d->max_vcpus )
+        return 0;
+
+    v = d->vcpu[vcpuid];
+    if ( v == NULL )
+        return 0;
+    if (test_bit(_VPF_down, &v->pause_flags) )
+        return 0;
+
+    return 1;
+}
+
+static int vgic_to_sgi(struct vcpu *v, register_t sgir)
+{
+    struct domain *d = v->domain;
+    int virtual_irq;
+    int filter;
+    int vcpuid;
+    int i;
+    unsigned long vcpu_mask = 0;
+
+    ASSERT(d->max_vcpus < 8*sizeof(vcpu_mask));
+
+    filter = (sgir & GICD_SGI_TARGET_LIST_MASK);
+    virtual_irq = (sgir & GICD_SGI_INTID_MASK);
+    ASSERT( virtual_irq < 16 );
+
+    switch ( filter )
+    {
+        case GICD_SGI_TARGET_LIST:
+            vcpu_mask = (sgir & GICD_SGI_TARGET_MASK) >> GICD_SGI_TARGET_SHIFT;
+            break;
+        case GICD_SGI_TARGET_OTHERS:
+            for ( i = 0; i < d->max_vcpus; i++ )
+            {
+                if ( i != current->vcpu_id && is_vcpu_running(d, i) )
+                    set_bit(i, &vcpu_mask);
+            }
+            break;
+        case GICD_SGI_TARGET_SELF:
+            set_bit(current->vcpu_id, &vcpu_mask);
+            break;
+        default:
+            gdprintk(XENLOG_WARNING, "vGICD: unhandled GICD_SGIR write %"PRIregister" with wrong TargetListFilter field\n",
+                     sgir);
+            return 0;
+    }
+
+    for_each_set_bit( vcpuid, &vcpu_mask, d->max_vcpus )
+    {
+        if ( !is_vcpu_running(d, vcpuid) )
+        {
+            gdprintk(XENLOG_WARNING, "vGICD: GICD_SGIR write r=%"PRIregister" vcpu_mask=%lx, wrong CPUTargetList\n",
+                     sgir, vcpu_mask);
+            continue;
+        }
+        vgic_vcpu_inject_irq(d->vcpu[vcpuid], virtual_irq, 1);
+    }
+    return 1;
+}
+
 static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 {
     struct hsr_dabt dabt = info->dabt;
@@ -498,10 +564,9 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     case GICD_SGIR:
-        if ( dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled write %#"PRIregister" to ICFGR%d\n",
-               *r, gicd_reg - GICD_ICFGR);
-        return 0;
+        if ( dabt.size != 2 )
+            goto bad_width;
+        return vgic_to_sgi(v, *r);
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 92711d5..bf2d0a0 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -51,12 +51,15 @@
 #define GICD_SPENDSGIRN (0xF2C/4)
 #define GICD_ICPIDR2    (0xFE8/4)
 
-#define GICD_SGI_TARGET_LIST   (0UL<<24)
-#define GICD_SGI_TARGET_OTHERS (1UL<<24)
-#define GICD_SGI_TARGET_SELF   (2UL<<24)
-#define GICD_SGI_TARGET_SHIFT  (16)
-#define GICD_SGI_TARGET_MASK   (0xFFUL<<GICD_SGI_TARGET_SHIFT)
-#define GICD_SGI_GROUP1        (1UL<<15)
+#define GICD_SGI_TARGET_LIST_SHIFT   (24)
+#define GICD_SGI_TARGET_LIST_MASK    (0x3UL << GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_LIST         (0UL<<GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_OTHERS       (1UL<<GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_SELF         (2UL<<GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_SHIFT        (16)
+#define GICD_SGI_TARGET_MASK         (0xFFUL<<GICD_SGI_TARGET_SHIFT)
+#define GICD_SGI_GROUP1              (1UL<<15)
+#define GICD_SGI_INTID_MASK          (0xFUL)
 
 #define GICC_CTLR       (0x0000/4)
 #define GICC_PMR        (0x0004/4)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9Wy-0005mQ-FX; Wed, 08 May 2013 18:56: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 1Ua9Ww-0005m7-Ho
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:58 +0000
Received: from [85.158.139.211:34493] by server-16.bemta-5.messagelabs.com id
	D7/C5-31493-DBF9A815; Wed, 08 May 2013 18:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1368039356!22242620!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11782 invoked from network); 8 May 2013 18:55:57 -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;
	8 May 2013 18:55: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 1Ua9Wt-0006RN-TL
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9Wt-0000lj-R5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:55:55 +0000
Date: Wed, 08 May 2013 18:55:55 +0000
Message-Id: <E1Ua9Wt-0000lj-R5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support for guest SGI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fbe58dd099cb8f2a86bd7cb0f8db14857ced1a8c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:41 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:15 2013 +0100

    xen/arm: support for guest SGI
    
    Trap writes to GICD_SGIR, parse the requests, inject SGIs into the right
    guest vcpu.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c       |   73 ++++++++++++++++++++++++++++++++++++++++++--
 xen/include/asm-arm/gic.h |   15 +++++----
 2 files changed, 78 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 99e7280..5d242c8 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -17,6 +17,7 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/bitops.h>
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/init.h>
@@ -368,6 +369,71 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     }
 }
 
+static inline int is_vcpu_running(struct domain *d, int vcpuid)
+{
+    struct vcpu *v;
+
+    if ( vcpuid >= d->max_vcpus )
+        return 0;
+
+    v = d->vcpu[vcpuid];
+    if ( v == NULL )
+        return 0;
+    if (test_bit(_VPF_down, &v->pause_flags) )
+        return 0;
+
+    return 1;
+}
+
+static int vgic_to_sgi(struct vcpu *v, register_t sgir)
+{
+    struct domain *d = v->domain;
+    int virtual_irq;
+    int filter;
+    int vcpuid;
+    int i;
+    unsigned long vcpu_mask = 0;
+
+    ASSERT(d->max_vcpus < 8*sizeof(vcpu_mask));
+
+    filter = (sgir & GICD_SGI_TARGET_LIST_MASK);
+    virtual_irq = (sgir & GICD_SGI_INTID_MASK);
+    ASSERT( virtual_irq < 16 );
+
+    switch ( filter )
+    {
+        case GICD_SGI_TARGET_LIST:
+            vcpu_mask = (sgir & GICD_SGI_TARGET_MASK) >> GICD_SGI_TARGET_SHIFT;
+            break;
+        case GICD_SGI_TARGET_OTHERS:
+            for ( i = 0; i < d->max_vcpus; i++ )
+            {
+                if ( i != current->vcpu_id && is_vcpu_running(d, i) )
+                    set_bit(i, &vcpu_mask);
+            }
+            break;
+        case GICD_SGI_TARGET_SELF:
+            set_bit(current->vcpu_id, &vcpu_mask);
+            break;
+        default:
+            gdprintk(XENLOG_WARNING, "vGICD: unhandled GICD_SGIR write %"PRIregister" with wrong TargetListFilter field\n",
+                     sgir);
+            return 0;
+    }
+
+    for_each_set_bit( vcpuid, &vcpu_mask, d->max_vcpus )
+    {
+        if ( !is_vcpu_running(d, vcpuid) )
+        {
+            gdprintk(XENLOG_WARNING, "vGICD: GICD_SGIR write r=%"PRIregister" vcpu_mask=%lx, wrong CPUTargetList\n",
+                     sgir, vcpu_mask);
+            continue;
+        }
+        vgic_vcpu_inject_irq(d->vcpu[vcpuid], virtual_irq, 1);
+    }
+    return 1;
+}
+
 static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 {
     struct hsr_dabt dabt = info->dabt;
@@ -498,10 +564,9 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     case GICD_SGIR:
-        if ( dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled write %#"PRIregister" to ICFGR%d\n",
-               *r, gicd_reg - GICD_ICFGR);
-        return 0;
+        if ( dabt.size != 2 )
+            goto bad_width;
+        return vgic_to_sgi(v, *r);
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 92711d5..bf2d0a0 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -51,12 +51,15 @@
 #define GICD_SPENDSGIRN (0xF2C/4)
 #define GICD_ICPIDR2    (0xFE8/4)
 
-#define GICD_SGI_TARGET_LIST   (0UL<<24)
-#define GICD_SGI_TARGET_OTHERS (1UL<<24)
-#define GICD_SGI_TARGET_SELF   (2UL<<24)
-#define GICD_SGI_TARGET_SHIFT  (16)
-#define GICD_SGI_TARGET_MASK   (0xFFUL<<GICD_SGI_TARGET_SHIFT)
-#define GICD_SGI_GROUP1        (1UL<<15)
+#define GICD_SGI_TARGET_LIST_SHIFT   (24)
+#define GICD_SGI_TARGET_LIST_MASK    (0x3UL << GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_LIST         (0UL<<GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_OTHERS       (1UL<<GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_SELF         (2UL<<GICD_SGI_TARGET_LIST_SHIFT)
+#define GICD_SGI_TARGET_SHIFT        (16)
+#define GICD_SGI_TARGET_MASK         (0xFFUL<<GICD_SGI_TARGET_SHIFT)
+#define GICD_SGI_GROUP1              (1UL<<15)
+#define GICD_SGI_INTID_MASK          (0xFUL)
 
 #define GICC_CTLR       (0x0000/4)
 #define GICC_PMR        (0x0004/4)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9X7-0005oW-IF; Wed, 08 May 2013 18:56:09 +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 1Ua9X6-0005oF-SO
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:09 +0000
Received: from [85.158.138.51:41700] by server-11.bemta-3.messagelabs.com id
	A9/2C-05438-8CF9A815; Wed, 08 May 2013 18:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1368039366!31834854!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22315 invoked from network); 8 May 2013 18:56:07 -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;
	8 May 2013 18:56: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 1Ua9X4-0006Rw-34
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9X4-0000m6-0t
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:06 +0000
Date: Wed, 08 May 2013 18:56:06 +0000
Message-Id: <E1Ua9X4-0000m6-0t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement arch_vmap_virt_end
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0d317248d432cf541854eef272c033bfd2515d9a
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:42 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:23 2013 +0100

    xen/arm: implement arch_vmap_virt_end
    
    Move virt_start out of ioremap and rename it to early_vmap_start.
    Implement arch_vmap_virt_end by returning early_vmap_start.
    
    Allocate virtual addresses in early_ioremap from top to bottom so that
    later on when we initialize vmap, we can return the end of the vmap
    address space (the last address allocated by early_ioremap).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index bd6d5f3..ea6c691 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -560,31 +560,40 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
  * start has to be 2MB aligned.
  * len has to be < EARLY_VMAP_VIRT_END - EARLY_VMAP_VIRT_START.
  */
+static __initdata unsigned long early_vmap_start = EARLY_VMAP_VIRT_END;
 void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
 {
-    static unsigned long virt_start = EARLY_VMAP_VIRT_START;
-    unsigned long ret_addr = virt_start;
     paddr_t end = start + len;
+    unsigned long map_start;
+
+    len = (len + SECOND_SIZE - 1) & ~SECOND_MASK;
+    early_vmap_start -= len;
 
     ASSERT(!(start & (~SECOND_MASK)));
-    ASSERT(!(virt_start & (~SECOND_MASK)));
+    ASSERT(!(early_vmap_start & (~SECOND_MASK)));
 
     /* The range we need to map is too big */
-    if ( virt_start + len >= EARLY_VMAP_VIRT_END )
+    if ( early_vmap_start >= EARLY_VMAP_VIRT_START )
         return NULL;
 
+    map_start = early_vmap_start;
     while ( start < end )
     {
         lpae_t e = mfn_to_xen_entry(start >> PAGE_SHIFT);
         e.pt.ai = attributes;
-        write_pte(xen_second + second_table_offset(virt_start), e);
+        write_pte(xen_second + second_table_offset(map_start), e);
 
         start += SECOND_SIZE;
-        virt_start += SECOND_SIZE;
+        map_start += SECOND_SIZE;
     }
-    flush_xen_data_tlb_range_va(ret_addr, len);
+    flush_xen_data_tlb_range_va(early_vmap_start, len);
+
+    return (void*)early_vmap_start;
+}
 
-    return (void*)ret_addr;
+void *__init arch_vmap_virt_end(void)
+{
+    return (void *)early_vmap_start;
 }
 
 enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9X7-0005oW-IF; Wed, 08 May 2013 18:56:09 +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 1Ua9X6-0005oF-SO
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:09 +0000
Received: from [85.158.138.51:41700] by server-11.bemta-3.messagelabs.com id
	A9/2C-05438-8CF9A815; Wed, 08 May 2013 18:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1368039366!31834854!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22315 invoked from network); 8 May 2013 18:56:07 -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;
	8 May 2013 18:56: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 1Ua9X4-0006Rw-34
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9X4-0000m6-0t
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:06 +0000
Date: Wed, 08 May 2013 18:56:06 +0000
Message-Id: <E1Ua9X4-0000m6-0t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement arch_vmap_virt_end
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0d317248d432cf541854eef272c033bfd2515d9a
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:42 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:23 2013 +0100

    xen/arm: implement arch_vmap_virt_end
    
    Move virt_start out of ioremap and rename it to early_vmap_start.
    Implement arch_vmap_virt_end by returning early_vmap_start.
    
    Allocate virtual addresses in early_ioremap from top to bottom so that
    later on when we initialize vmap, we can return the end of the vmap
    address space (the last address allocated by early_ioremap).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index bd6d5f3..ea6c691 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -560,31 +560,40 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
  * start has to be 2MB aligned.
  * len has to be < EARLY_VMAP_VIRT_END - EARLY_VMAP_VIRT_START.
  */
+static __initdata unsigned long early_vmap_start = EARLY_VMAP_VIRT_END;
 void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
 {
-    static unsigned long virt_start = EARLY_VMAP_VIRT_START;
-    unsigned long ret_addr = virt_start;
     paddr_t end = start + len;
+    unsigned long map_start;
+
+    len = (len + SECOND_SIZE - 1) & ~SECOND_MASK;
+    early_vmap_start -= len;
 
     ASSERT(!(start & (~SECOND_MASK)));
-    ASSERT(!(virt_start & (~SECOND_MASK)));
+    ASSERT(!(early_vmap_start & (~SECOND_MASK)));
 
     /* The range we need to map is too big */
-    if ( virt_start + len >= EARLY_VMAP_VIRT_END )
+    if ( early_vmap_start >= EARLY_VMAP_VIRT_START )
         return NULL;
 
+    map_start = early_vmap_start;
     while ( start < end )
     {
         lpae_t e = mfn_to_xen_entry(start >> PAGE_SHIFT);
         e.pt.ai = attributes;
-        write_pte(xen_second + second_table_offset(virt_start), e);
+        write_pte(xen_second + second_table_offset(map_start), e);
 
         start += SECOND_SIZE;
-        virt_start += SECOND_SIZE;
+        map_start += SECOND_SIZE;
     }
-    flush_xen_data_tlb_range_va(ret_addr, len);
+    flush_xen_data_tlb_range_va(early_vmap_start, len);
+
+    return (void*)early_vmap_start;
+}
 
-    return (void*)ret_addr;
+void *__init arch_vmap_virt_end(void)
+{
+    return (void *)early_vmap_start;
 }
 
 enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9XI-0005qX-LG; Wed, 08 May 2013 18:56:20 +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 1Ua9XH-0005qF-Aq
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:19 +0000
Received: from [85.158.139.211:53750] by server-2.bemta-5.messagelabs.com id
	25/C9-26552-2DF9A815; Wed, 08 May 2013 18:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1368039376!22272646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29515 invoked from network); 8 May 2013 18:56:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 May 2013 18:56: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 1Ua9XE-0006S5-9Q
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9XE-0000mw-7I
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:16 +0000
Date: Wed, 08 May 2013 18:56:16 +0000
Message-Id: <E1Ua9XE-0000mw-7I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: compile and initialize vmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f62544055cb72b0a2d65b5e7943f7615f6ffa7fd
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:43 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:30 2013 +0100

    xen/arm: compile and initialize vmap
    
    Rename EARLY_VMAP_VIRT_END and EARLY_VMAP_VIRT_START to
    VMAP_VIRT_END and VMAP_VIRT_START.
    
    Defining VMAP_VIRT_START triggers the compilation of common/vmap.c.
    
    Define PAGE_HYPERVISOR and MAP_SMALL_PAGES (unused on ARM, because we
    only support 4K pages so as a matter of fact it is always set).
    
    Implement map_pages_to_xen and destroy_xen_mappings.
    
    Call vm_init from start_xen.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c            |  100 ++++++++++++++++++++++++++++++++++++++++-
 xen/arch/arm/setup.c         |    3 +
 xen/include/asm-arm/config.h |    4 +-
 xen/include/asm-arm/page.h   |    3 +
 xen/include/asm-x86/page.h   |    8 ---
 xen/include/xen/mm.h         |    7 +++
 6 files changed, 112 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index ea6c691..6bb3005 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -33,6 +33,7 @@
 #include <xen/err.h>
 #include <asm/page.h>
 #include <asm/current.h>
+#include <asm/flushtlb.h>
 #include <public/memory.h>
 #include <xen/sched.h>
 #include <xsm/xsm.h>
@@ -558,9 +559,9 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
 /* Map the physical memory range start -  start + len into virtual
  * memory and return the virtual address of the mapping.
  * start has to be 2MB aligned.
- * len has to be < EARLY_VMAP_VIRT_END - EARLY_VMAP_VIRT_START.
+ * len has to be < VMAP_VIRT_END - VMAP_VIRT_START.
  */
-static __initdata unsigned long early_vmap_start = EARLY_VMAP_VIRT_END;
+static __initdata unsigned long early_vmap_start = VMAP_VIRT_END;
 void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
 {
     paddr_t end = start + len;
@@ -573,7 +574,7 @@ void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
     ASSERT(!(early_vmap_start & (~SECOND_MASK)));
 
     /* The range we need to map is too big */
-    if ( early_vmap_start >= EARLY_VMAP_VIRT_START )
+    if ( early_vmap_start >= VMAP_VIRT_START )
         return NULL;
 
     map_start = early_vmap_start;
@@ -596,6 +597,99 @@ void *__init arch_vmap_virt_end(void)
     return (void *)early_vmap_start;
 }
 
+static int create_xen_table(lpae_t *entry)
+{
+    void *p;
+    lpae_t pte;
+
+    p = alloc_xenheap_page();
+    if ( p == NULL )
+        return -ENOMEM;
+    clear_page(p);
+    pte = mfn_to_xen_entry(virt_to_mfn(p));
+    pte.pt.table = 1;
+    write_pte(entry, pte);
+    return 0;
+}
+
+enum xenmap_operation {
+    INSERT,
+    REMOVE
+};
+
+static int create_xen_entries(enum xenmap_operation op,
+                              unsigned long virt,
+                              unsigned long mfn,
+                              unsigned long nr_mfns)
+{
+    int rc;
+    unsigned long addr = virt, addr_end = addr + nr_mfns * PAGE_SIZE;
+    lpae_t pte;
+    lpae_t *third = NULL;
+
+    for(; addr < addr_end; addr += PAGE_SIZE, mfn++)
+    {
+        if ( !xen_second[second_linear_offset(addr)].pt.valid ||
+             !xen_second[second_linear_offset(addr)].pt.table )
+        {
+            rc = create_xen_table(&xen_second[second_linear_offset(addr)]);
+            if ( rc < 0 ) {
+                printk("create_xen_entries: L2 failed\n");
+                goto out;
+            }
+        }
+
+        BUG_ON(!xen_second[second_linear_offset(addr)].pt.valid);
+
+        third = __va(pfn_to_paddr(xen_second[second_linear_offset(addr)].pt.base));
+
+        switch ( op ) {
+            case INSERT:
+                if ( third[third_table_offset(addr)].pt.valid )
+                {
+                    printk("create_xen_entries: trying to replace an existing mapping addr=%lx mfn=%lx\n",
+                           addr, mfn);
+                    return -EINVAL;
+                }
+                pte = mfn_to_xen_entry(mfn);
+                pte.pt.table = 1;
+                write_pte(&third[third_table_offset(addr)], pte);
+                break;
+            case REMOVE:
+                if ( !third[third_table_offset(addr)].pt.valid )
+                {
+                    printk("create_xen_entries: trying to remove a non-existing mapping addr=%lx\n",
+                           addr);
+                    return -EINVAL;
+                }
+                pte.bits = 0;
+                write_pte(&third[third_table_offset(addr)], pte);
+                break;
+            default:
+                BUG();
+        }
+    }
+    flush_xen_data_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
+
+    rc = 0;
+
+out:
+    return rc;
+}
+
+int map_pages_to_xen(unsigned long virt,
+                     unsigned long mfn,
+                     unsigned long nr_mfns,
+                     unsigned int flags)
+{
+    ASSERT(flags == PAGE_HYPERVISOR);
+    return create_xen_entries(INSERT, virt, mfn, nr_mfns);
+}
+void destroy_xen_mappings(unsigned long v, unsigned long e)
+{
+    create_xen_entries(REMOVE, v, 0, (e - v) >> PAGE_SHIFT);
+}
+
 enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
 static void set_pte_flags_on_range(const char *p, unsigned long l, enum mg mg)
 {
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cfe3d94..59646d6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -34,6 +34,7 @@
 #include <xen/keyhandler.h>
 #include <xen/cpu.h>
 #include <xen/pfn.h>
+#include <xen/vmap.h>
 #include <asm/page.h>
 #include <asm/current.h>
 #include <asm/setup.h>
@@ -480,6 +481,8 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     console_init_postirq();
 
+    vm_init();
+
     do_presmp_initcalls();
 
     for_each_present_cpu ( i )
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index e49aac1..98a3a43 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -95,12 +95,12 @@
 #define FIXMAP_ADDR(n)        (mk_unsigned_long(0x00400000) + (n) * PAGE_SIZE)
 #define BOOT_MISC_VIRT_START   mk_unsigned_long(0x00600000)
 #define FRAMETABLE_VIRT_START  mk_unsigned_long(0x02000000)
-#define EARLY_VMAP_VIRT_START  mk_unsigned_long(0x10000000)
+#define VMAP_VIRT_START        mk_unsigned_long(0x10000000)
 #define XENHEAP_VIRT_START     mk_unsigned_long(0x40000000)
 #define DOMHEAP_VIRT_START     mk_unsigned_long(0x80000000)
 #define DOMHEAP_VIRT_END       mk_unsigned_long(0xffffffff)
 
-#define EARLY_VMAP_VIRT_END    XENHEAP_VIRT_START
+#define VMAP_VIRT_END          XENHEAP_VIRT_START
 #define HYPERVISOR_VIRT_START  XEN_VIRT_START
 
 #define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index a6a312f..fd6946e 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -58,6 +58,9 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
+#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define MAP_SMALL_PAGES         PAGE_HYPERVISOR
+
 /*
  * Stage 2 Memory Type.
  *
diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
index b2f3859..e53e1e5 100644
--- a/xen/include/asm-x86/page.h
+++ b/xen/include/asm-x86/page.h
@@ -338,14 +338,6 @@ l3_pgentry_t *virt_to_xen_l3e(unsigned long v);
 
 extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
 
-/* Map machine page range in Xen virtual address space. */
-int map_pages_to_xen(
-    unsigned long virt,
-    unsigned long mfn,
-    unsigned long nr_mfns,
-    unsigned int flags);
-void destroy_xen_mappings(unsigned long v, unsigned long e);
-
 /* Convert between PAT/PCD/PWT embedded in PTE flags and 3-bit cacheattr. */
 static inline uint32_t pte_flags_to_cacheattr(uint32_t flags)
 {
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 28512fb..efc45c7 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void *alloc_xenheap_pages(unsigned int order, unsigned int memflags);
 void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
+/* Map machine page range in Xen virtual address space. */
+int map_pages_to_xen(
+    unsigned long virt,
+    unsigned long mfn,
+    unsigned long nr_mfns,
+    unsigned int flags);
+void destroy_xen_mappings(unsigned long v, unsigned long e);
 
 /* Claim handling */
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9XI-0005qX-LG; Wed, 08 May 2013 18:56:20 +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 1Ua9XH-0005qF-Aq
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:19 +0000
Received: from [85.158.139.211:53750] by server-2.bemta-5.messagelabs.com id
	25/C9-26552-2DF9A815; Wed, 08 May 2013 18:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1368039376!22272646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29515 invoked from network); 8 May 2013 18:56:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 May 2013 18:56: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 1Ua9XE-0006S5-9Q
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9XE-0000mw-7I
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:16 +0000
Date: Wed, 08 May 2013 18:56:16 +0000
Message-Id: <E1Ua9XE-0000mw-7I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: compile and initialize vmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f62544055cb72b0a2d65b5e7943f7615f6ffa7fd
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:43 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:02:30 2013 +0100

    xen/arm: compile and initialize vmap
    
    Rename EARLY_VMAP_VIRT_END and EARLY_VMAP_VIRT_START to
    VMAP_VIRT_END and VMAP_VIRT_START.
    
    Defining VMAP_VIRT_START triggers the compilation of common/vmap.c.
    
    Define PAGE_HYPERVISOR and MAP_SMALL_PAGES (unused on ARM, because we
    only support 4K pages so as a matter of fact it is always set).
    
    Implement map_pages_to_xen and destroy_xen_mappings.
    
    Call vm_init from start_xen.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c            |  100 ++++++++++++++++++++++++++++++++++++++++-
 xen/arch/arm/setup.c         |    3 +
 xen/include/asm-arm/config.h |    4 +-
 xen/include/asm-arm/page.h   |    3 +
 xen/include/asm-x86/page.h   |    8 ---
 xen/include/xen/mm.h         |    7 +++
 6 files changed, 112 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index ea6c691..6bb3005 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -33,6 +33,7 @@
 #include <xen/err.h>
 #include <asm/page.h>
 #include <asm/current.h>
+#include <asm/flushtlb.h>
 #include <public/memory.h>
 #include <xen/sched.h>
 #include <xsm/xsm.h>
@@ -558,9 +559,9 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
 /* Map the physical memory range start -  start + len into virtual
  * memory and return the virtual address of the mapping.
  * start has to be 2MB aligned.
- * len has to be < EARLY_VMAP_VIRT_END - EARLY_VMAP_VIRT_START.
+ * len has to be < VMAP_VIRT_END - VMAP_VIRT_START.
  */
-static __initdata unsigned long early_vmap_start = EARLY_VMAP_VIRT_END;
+static __initdata unsigned long early_vmap_start = VMAP_VIRT_END;
 void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
 {
     paddr_t end = start + len;
@@ -573,7 +574,7 @@ void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
     ASSERT(!(early_vmap_start & (~SECOND_MASK)));
 
     /* The range we need to map is too big */
-    if ( early_vmap_start >= EARLY_VMAP_VIRT_START )
+    if ( early_vmap_start >= VMAP_VIRT_START )
         return NULL;
 
     map_start = early_vmap_start;
@@ -596,6 +597,99 @@ void *__init arch_vmap_virt_end(void)
     return (void *)early_vmap_start;
 }
 
+static int create_xen_table(lpae_t *entry)
+{
+    void *p;
+    lpae_t pte;
+
+    p = alloc_xenheap_page();
+    if ( p == NULL )
+        return -ENOMEM;
+    clear_page(p);
+    pte = mfn_to_xen_entry(virt_to_mfn(p));
+    pte.pt.table = 1;
+    write_pte(entry, pte);
+    return 0;
+}
+
+enum xenmap_operation {
+    INSERT,
+    REMOVE
+};
+
+static int create_xen_entries(enum xenmap_operation op,
+                              unsigned long virt,
+                              unsigned long mfn,
+                              unsigned long nr_mfns)
+{
+    int rc;
+    unsigned long addr = virt, addr_end = addr + nr_mfns * PAGE_SIZE;
+    lpae_t pte;
+    lpae_t *third = NULL;
+
+    for(; addr < addr_end; addr += PAGE_SIZE, mfn++)
+    {
+        if ( !xen_second[second_linear_offset(addr)].pt.valid ||
+             !xen_second[second_linear_offset(addr)].pt.table )
+        {
+            rc = create_xen_table(&xen_second[second_linear_offset(addr)]);
+            if ( rc < 0 ) {
+                printk("create_xen_entries: L2 failed\n");
+                goto out;
+            }
+        }
+
+        BUG_ON(!xen_second[second_linear_offset(addr)].pt.valid);
+
+        third = __va(pfn_to_paddr(xen_second[second_linear_offset(addr)].pt.base));
+
+        switch ( op ) {
+            case INSERT:
+                if ( third[third_table_offset(addr)].pt.valid )
+                {
+                    printk("create_xen_entries: trying to replace an existing mapping addr=%lx mfn=%lx\n",
+                           addr, mfn);
+                    return -EINVAL;
+                }
+                pte = mfn_to_xen_entry(mfn);
+                pte.pt.table = 1;
+                write_pte(&third[third_table_offset(addr)], pte);
+                break;
+            case REMOVE:
+                if ( !third[third_table_offset(addr)].pt.valid )
+                {
+                    printk("create_xen_entries: trying to remove a non-existing mapping addr=%lx\n",
+                           addr);
+                    return -EINVAL;
+                }
+                pte.bits = 0;
+                write_pte(&third[third_table_offset(addr)], pte);
+                break;
+            default:
+                BUG();
+        }
+    }
+    flush_xen_data_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
+
+    rc = 0;
+
+out:
+    return rc;
+}
+
+int map_pages_to_xen(unsigned long virt,
+                     unsigned long mfn,
+                     unsigned long nr_mfns,
+                     unsigned int flags)
+{
+    ASSERT(flags == PAGE_HYPERVISOR);
+    return create_xen_entries(INSERT, virt, mfn, nr_mfns);
+}
+void destroy_xen_mappings(unsigned long v, unsigned long e)
+{
+    create_xen_entries(REMOVE, v, 0, (e - v) >> PAGE_SHIFT);
+}
+
 enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
 static void set_pte_flags_on_range(const char *p, unsigned long l, enum mg mg)
 {
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cfe3d94..59646d6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -34,6 +34,7 @@
 #include <xen/keyhandler.h>
 #include <xen/cpu.h>
 #include <xen/pfn.h>
+#include <xen/vmap.h>
 #include <asm/page.h>
 #include <asm/current.h>
 #include <asm/setup.h>
@@ -480,6 +481,8 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     console_init_postirq();
 
+    vm_init();
+
     do_presmp_initcalls();
 
     for_each_present_cpu ( i )
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index e49aac1..98a3a43 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -95,12 +95,12 @@
 #define FIXMAP_ADDR(n)        (mk_unsigned_long(0x00400000) + (n) * PAGE_SIZE)
 #define BOOT_MISC_VIRT_START   mk_unsigned_long(0x00600000)
 #define FRAMETABLE_VIRT_START  mk_unsigned_long(0x02000000)
-#define EARLY_VMAP_VIRT_START  mk_unsigned_long(0x10000000)
+#define VMAP_VIRT_START        mk_unsigned_long(0x10000000)
 #define XENHEAP_VIRT_START     mk_unsigned_long(0x40000000)
 #define DOMHEAP_VIRT_START     mk_unsigned_long(0x80000000)
 #define DOMHEAP_VIRT_END       mk_unsigned_long(0xffffffff)
 
-#define EARLY_VMAP_VIRT_END    XENHEAP_VIRT_START
+#define VMAP_VIRT_END          XENHEAP_VIRT_START
 #define HYPERVISOR_VIRT_START  XEN_VIRT_START
 
 #define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index a6a312f..fd6946e 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -58,6 +58,9 @@
 #define DEV_WC        BUFFERABLE
 #define DEV_CACHED    WRITEBACK
 
+#define PAGE_HYPERVISOR         (MATTR_MEM)
+#define MAP_SMALL_PAGES         PAGE_HYPERVISOR
+
 /*
  * Stage 2 Memory Type.
  *
diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
index b2f3859..e53e1e5 100644
--- a/xen/include/asm-x86/page.h
+++ b/xen/include/asm-x86/page.h
@@ -338,14 +338,6 @@ l3_pgentry_t *virt_to_xen_l3e(unsigned long v);
 
 extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
 
-/* Map machine page range in Xen virtual address space. */
-int map_pages_to_xen(
-    unsigned long virt,
-    unsigned long mfn,
-    unsigned long nr_mfns,
-    unsigned int flags);
-void destroy_xen_mappings(unsigned long v, unsigned long e);
-
 /* Convert between PAT/PCD/PWT embedded in PTE flags and 3-bit cacheattr. */
 static inline uint32_t pte_flags_to_cacheattr(uint32_t flags)
 {
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 28512fb..efc45c7 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -48,6 +48,13 @@ void *alloc_xenheap_pages(unsigned int order, unsigned int memflags);
 void free_xenheap_pages(void *v, unsigned int order);
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
+/* Map machine page range in Xen virtual address space. */
+int map_pages_to_xen(
+    unsigned long virt,
+    unsigned long mfn,
+    unsigned long nr_mfns,
+    unsigned int flags);
+void destroy_xen_mappings(unsigned long v, unsigned long e);
 
 /* Claim handling */
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9XR-0005sh-Od; Wed, 08 May 2013 18:56:29 +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 1Ua9XR-0005sR-94
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:29 +0000
Received: from [85.158.138.51:42494] by server-9.bemta-3.messagelabs.com id
	2C/B4-29224-CDF9A815; Wed, 08 May 2013 18:56:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1368039386!18669697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25517 invoked from network); 8 May 2013 18:56:27 -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;
	8 May 2013 18:56: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 1Ua9XO-0006SB-Iz
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9XO-0000nI-D7
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:26 +0000
Date: Wed, 08 May 2013 18:56:26 +0000
Message-Id: <E1Ua9XO-0000nI-D7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement
	map_domain_page_global and unmap_domain_page_global
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a32dbcef6d917e6019e2a5a1467276a555d7ec34
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:06:16 2013 +0100

    xen/arm: implement map_domain_page_global and unmap_domain_page_global
    
    The implementation uses vmap and vunmap.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6bb3005..2836cbb 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -36,6 +36,7 @@
 #include <asm/flushtlb.h>
 #include <public/memory.h>
 #include <xen/sched.h>
+#include <xen/vmap.h>
 #include <xsm/xsm.h>
 
 struct domain *dom_xen, *dom_io, *dom_cow;
@@ -177,6 +178,16 @@ void clear_fixmap(unsigned map)
     flush_xen_data_tlb_range_va(FIXMAP_ADDR(map), PAGE_SIZE);
 }
 
+void *map_domain_page_global(unsigned long mfn)
+{
+    return vmap(&mfn, 1);
+}
+
+void unmap_domain_page_global(const void *va)
+{
+    vunmap(va);
+}
+
 /* Map a page of domheap memory */
 void *map_domain_page(unsigned long mfn)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9XR-0005sh-Od; Wed, 08 May 2013 18:56:29 +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 1Ua9XR-0005sR-94
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:29 +0000
Received: from [85.158.138.51:42494] by server-9.bemta-3.messagelabs.com id
	2C/B4-29224-CDF9A815; Wed, 08 May 2013 18:56:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1368039386!18669697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25517 invoked from network); 8 May 2013 18:56:27 -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;
	8 May 2013 18:56: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 1Ua9XO-0006SB-Iz
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9XO-0000nI-D7
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:26 +0000
Date: Wed, 08 May 2013 18:56:26 +0000
Message-Id: <E1Ua9XO-0000nI-D7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement
	map_domain_page_global and unmap_domain_page_global
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a32dbcef6d917e6019e2a5a1467276a555d7ec34
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 15:12:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:06:16 2013 +0100

    xen/arm: implement map_domain_page_global and unmap_domain_page_global
    
    The implementation uses vmap and vunmap.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6bb3005..2836cbb 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -36,6 +36,7 @@
 #include <asm/flushtlb.h>
 #include <public/memory.h>
 #include <xen/sched.h>
+#include <xen/vmap.h>
 #include <xsm/xsm.h>
 
 struct domain *dom_xen, *dom_io, *dom_cow;
@@ -177,6 +178,16 @@ void clear_fixmap(unsigned map)
     flush_xen_data_tlb_range_va(FIXMAP_ADDR(map), PAGE_SIZE);
 }
 
+void *map_domain_page_global(unsigned long mfn)
+{
+    return vmap(&mfn, 1);
+}
+
+void unmap_domain_page_global(const void *va)
+{
+    vunmap(va);
+}
+
 /* Map a page of domheap memory */
 void *map_domain_page(unsigned long mfn)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9Xc-0005uw-Rd; Wed, 08 May 2013 18:56:40 +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 1Ua9Xb-0005uZ-Lr
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:39 +0000
Received: from [85.158.143.99:36625] by server-1.bemta-4.messagelabs.com id
	37/C4-06122-6EF9A815; Wed, 08 May 2013 18:56:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368039396!27441604!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29513 invoked from network); 8 May 2013 18:56:37 -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;
	8 May 2013 18:56:37 -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 1Ua9XY-0006SJ-P5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9XY-0000oR-NW
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:36 +0000
Date: Wed, 08 May 2013 18:56:36 +0000
Message-Id: <E1Ua9XY-0000oR-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement smp_call_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

commit 68385d841171d46985e2c41d751a2b81b3b3813b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue May 7 12:05:06 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:06:22 2013 +0100

    xen/arm: implement smp_call_function
    
    Move smp_call_function and on_selected_cpus to common code.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/gic.c            |    3 +
 xen/arch/arm/smp.c            |   11 ++---
 xen/arch/x86/smp.c            |   88 ++------------------------------
 xen/common/Makefile           |    1 +
 xen/common/smp.c              |  112 +++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h     |    1 +
 xen/include/asm-x86/hardirq.h |    1 +
 xen/include/xen/smp.h         |    7 +++
 8 files changed, 134 insertions(+), 90 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8a49e12..1bcb0ca 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -658,6 +658,9 @@ static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
     case GIC_SGI_DUMP_STATE:
         dump_execstate(regs);
         break;
+    case GIC_SGI_CALL_FUNCTION:
+        smp_call_function_interrupt();
+        break;
     default:
         panic("Unhandled SGI %d on CPU%d\n", sgi, smp_processor_id());
         break;
diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c
index 2a429bd..4042db5 100644
--- a/xen/arch/arm/smp.c
+++ b/xen/arch/arm/smp.c
@@ -11,17 +11,14 @@ void flush_tlb_mask(const cpumask_t *mask)
     flush_xen_data_tlb();
 }
 
-void smp_call_function(
-    void (*func) (void *info),
-    void *info,
-    int wait)
+void smp_send_event_check_mask(const cpumask_t *mask)
 {
-    printk("%s not implmented\n", __func__);
+    send_SGI_mask(mask, GIC_SGI_EVENT_CHECK);
 }
 
-void smp_send_event_check_mask(const cpumask_t *mask)
+void smp_send_call_function_mask(const cpumask_t *mask)
 {
-    send_SGI_mask(mask, GIC_SGI_EVENT_CHECK);
+    send_SGI_mask(mask, GIC_SGI_CALL_FUNCTION);
 }
 
 /*
diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
index a607531..0433f30 100644
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -269,67 +269,16 @@ void smp_send_event_check_mask(const cpumask_t *mask)
     send_IPI_mask(mask, EVENT_CHECK_VECTOR);
 }
 
-/*
- * Structure and data for smp_call_function()/on_selected_cpus().
- */
-
-static void __smp_call_function_interrupt(void);
-static DEFINE_SPINLOCK(call_lock);
-static struct call_data_struct {
-    void (*func) (void *info);
-    void *info;
-    int wait;
-    cpumask_t selected;
-} call_data;
-
-void smp_call_function(
-    void (*func) (void *info),
-    void *info,
-    int wait)
+void smp_send_call_function_mask(const cpumask_t *mask)
 {
-    cpumask_t allbutself;
-
-    cpumask_andnot(&allbutself, &cpu_online_map,
-                   cpumask_of(smp_processor_id()));
-    on_selected_cpus(&allbutself, func, info, wait);
-}
-
-void on_selected_cpus(
-    const cpumask_t *selected,
-    void (*func) (void *info),
-    void *info,
-    int wait)
-{
-    unsigned int nr_cpus;
-
-    ASSERT(local_irq_is_enabled());
-
-    spin_lock(&call_lock);
-
-    cpumask_copy(&call_data.selected, selected);
-
-    nr_cpus = cpumask_weight(&call_data.selected);
-    if ( nr_cpus == 0 )
-        goto out;
-
-    call_data.func = func;
-    call_data.info = info;
-    call_data.wait = wait;
-
-    send_IPI_mask(&call_data.selected, CALL_FUNCTION_VECTOR);
+    send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
 
-    if ( cpumask_test_cpu(smp_processor_id(), &call_data.selected) )
+    if ( cpumask_test_cpu(smp_processor_id(), mask) )
     {
         local_irq_disable();
-        __smp_call_function_interrupt();
+        smp_call_function_interrupt();
         local_irq_enable();
     }
-
-    while ( !cpumask_empty(&call_data.selected) )
-        cpu_relax();
-
- out:
-    spin_unlock(&call_lock);
 }
 
 void __stop_this_cpu(void)
@@ -390,36 +339,9 @@ void event_check_interrupt(struct cpu_user_regs *regs)
     this_cpu(irq_count)++;
 }
 
-static void __smp_call_function_interrupt(void)
-{
-    void (*func)(void *info) = call_data.func;
-    void *info = call_data.info;
-    unsigned int cpu = smp_processor_id();
-
-    if ( !cpumask_test_cpu(cpu, &call_data.selected) )
-        return;
-
-    irq_enter();
-
-    if ( call_data.wait )
-    {
-        (*func)(info);
-        mb();
-        cpumask_clear_cpu(cpu, &call_data.selected);
-    }
-    else
-    {
-        mb();
-        cpumask_clear_cpu(cpu, &call_data.selected);
-        (*func)(info);
-    }
-
-    irq_exit();
-}
-
 void call_function_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
     perfc_incr(ipis);
-    __smp_call_function_interrupt();
+    smp_call_function_interrupt();
 }
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 8a0c506..0dc2050 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -26,6 +26,7 @@ obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += sort.o
+obj-y += smp.o
 obj-y += spinlock.o
 obj-y += stop_machine.o
 obj-y += string.o
diff --git a/xen/common/smp.c b/xen/common/smp.c
new file mode 100644
index 0000000..b2b056b
--- /dev/null
+++ b/xen/common/smp.c
@@ -0,0 +1,112 @@
+/*
+ * xen/common/smp.c
+ *
+ * Generic SMP function
+ *
+ * Copyright (c) 2013 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/hardirq.h>
+#include <asm/processor.h>
+#include <xen/spinlock.h>
+#include <xen/smp.h>
+
+/*
+ * Structure and data for smp_call_function()/on_selected_cpus().
+ */
+static DEFINE_SPINLOCK(call_lock);
+static struct call_data_struct {
+    void (*func) (void *info);
+    void *info;
+    int wait;
+    cpumask_t selected;
+} call_data;
+
+void smp_call_function(
+    void (*func) (void *info),
+    void *info,
+    int wait)
+{
+    cpumask_t allbutself;
+
+    cpumask_andnot(&allbutself, &cpu_online_map,
+                   cpumask_of(smp_processor_id()));
+    on_selected_cpus(&allbutself, func, info, wait);
+}
+
+void on_selected_cpus(
+    const cpumask_t *selected,
+    void (*func) (void *info),
+    void *info,
+    int wait)
+{
+    unsigned int nr_cpus;
+
+    ASSERT(local_irq_is_enabled());
+
+    spin_lock(&call_lock);
+
+    cpumask_copy(&call_data.selected, selected);
+
+    nr_cpus = cpumask_weight(&call_data.selected);
+    if ( nr_cpus == 0 )
+        goto out;
+
+    call_data.func = func;
+    call_data.info = info;
+    call_data.wait = wait;
+
+    smp_send_call_function_mask(&call_data.selected);
+
+    while ( !cpumask_empty(&call_data.selected) )
+        cpu_relax();
+
+out:
+    spin_unlock(&call_lock);
+}
+
+void smp_call_function_interrupt(void)
+{
+    void (*func)(void *info) = call_data.func;
+    void *info = call_data.info;
+    unsigned int cpu = smp_processor_id();
+
+    if ( !cpumask_test_cpu(cpu, &call_data.selected) )
+        return;
+
+    irq_enter();
+
+    if ( call_data.wait )
+    {
+        (*func)(info);
+        mb();
+        cpumask_clear_cpu(cpu, &call_data.selected);
+    }
+    else
+    {
+        mb();
+        cpumask_clear_cpu(cpu, &call_data.selected);
+        (*func)(info);
+    }
+
+    irq_exit();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index bf2d0a0..0f9f74b 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -173,6 +173,7 @@ extern void gic_restore_state(struct vcpu *v);
 enum gic_sgi {
     GIC_SGI_EVENT_CHECK = 0,
     GIC_SGI_DUMP_STATE  = 1,
+    GIC_SGI_CALL_FUNCTION = 2,
 };
 extern void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi);
 extern void send_SGI_one(unsigned int cpu, enum gic_sgi sgi);
diff --git a/xen/include/asm-x86/hardirq.h b/xen/include/asm-x86/hardirq.h
index e573007..01a41b9 100644
--- a/xen/include/asm-x86/hardirq.h
+++ b/xen/include/asm-x86/hardirq.h
@@ -3,6 +3,7 @@
 
 #include <xen/config.h>
 #include <xen/cache.h>
+#include <xen/types.h>
 
 typedef struct {
 	unsigned int __softirq_pending;
diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h
index e05f390..6febb56 100644
--- a/xen/include/xen/smp.h
+++ b/xen/include/xen/smp.h
@@ -58,6 +58,13 @@ static inline void on_each_cpu(
     on_selected_cpus(&cpu_online_map, func, info, wait);
 }
 
+/*
+ * Call a function on the current CPU
+ */
+void smp_call_function_interrupt(void);
+
+void smp_send_call_function_mask(const cpumask_t *mask);
+
 #define smp_processor_id() raw_smp_processor_id()
 
 int alloc_cpu_id(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9Xc-0005uw-Rd; Wed, 08 May 2013 18:56:40 +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 1Ua9Xb-0005uZ-Lr
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:39 +0000
Received: from [85.158.143.99:36625] by server-1.bemta-4.messagelabs.com id
	37/C4-06122-6EF9A815; Wed, 08 May 2013 18:56:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368039396!27441604!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29513 invoked from network); 8 May 2013 18:56:37 -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;
	8 May 2013 18:56:37 -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 1Ua9XY-0006SJ-P5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9XY-0000oR-NW
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:36 +0000
Date: Wed, 08 May 2013 18:56:36 +0000
Message-Id: <E1Ua9XY-0000oR-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement smp_call_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

commit 68385d841171d46985e2c41d751a2b81b3b3813b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue May 7 12:05:06 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:06:22 2013 +0100

    xen/arm: implement smp_call_function
    
    Move smp_call_function and on_selected_cpus to common code.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/gic.c            |    3 +
 xen/arch/arm/smp.c            |   11 ++---
 xen/arch/x86/smp.c            |   88 ++------------------------------
 xen/common/Makefile           |    1 +
 xen/common/smp.c              |  112 +++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h     |    1 +
 xen/include/asm-x86/hardirq.h |    1 +
 xen/include/xen/smp.h         |    7 +++
 8 files changed, 134 insertions(+), 90 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8a49e12..1bcb0ca 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -658,6 +658,9 @@ static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
     case GIC_SGI_DUMP_STATE:
         dump_execstate(regs);
         break;
+    case GIC_SGI_CALL_FUNCTION:
+        smp_call_function_interrupt();
+        break;
     default:
         panic("Unhandled SGI %d on CPU%d\n", sgi, smp_processor_id());
         break;
diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c
index 2a429bd..4042db5 100644
--- a/xen/arch/arm/smp.c
+++ b/xen/arch/arm/smp.c
@@ -11,17 +11,14 @@ void flush_tlb_mask(const cpumask_t *mask)
     flush_xen_data_tlb();
 }
 
-void smp_call_function(
-    void (*func) (void *info),
-    void *info,
-    int wait)
+void smp_send_event_check_mask(const cpumask_t *mask)
 {
-    printk("%s not implmented\n", __func__);
+    send_SGI_mask(mask, GIC_SGI_EVENT_CHECK);
 }
 
-void smp_send_event_check_mask(const cpumask_t *mask)
+void smp_send_call_function_mask(const cpumask_t *mask)
 {
-    send_SGI_mask(mask, GIC_SGI_EVENT_CHECK);
+    send_SGI_mask(mask, GIC_SGI_CALL_FUNCTION);
 }
 
 /*
diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
index a607531..0433f30 100644
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -269,67 +269,16 @@ void smp_send_event_check_mask(const cpumask_t *mask)
     send_IPI_mask(mask, EVENT_CHECK_VECTOR);
 }
 
-/*
- * Structure and data for smp_call_function()/on_selected_cpus().
- */
-
-static void __smp_call_function_interrupt(void);
-static DEFINE_SPINLOCK(call_lock);
-static struct call_data_struct {
-    void (*func) (void *info);
-    void *info;
-    int wait;
-    cpumask_t selected;
-} call_data;
-
-void smp_call_function(
-    void (*func) (void *info),
-    void *info,
-    int wait)
+void smp_send_call_function_mask(const cpumask_t *mask)
 {
-    cpumask_t allbutself;
-
-    cpumask_andnot(&allbutself, &cpu_online_map,
-                   cpumask_of(smp_processor_id()));
-    on_selected_cpus(&allbutself, func, info, wait);
-}
-
-void on_selected_cpus(
-    const cpumask_t *selected,
-    void (*func) (void *info),
-    void *info,
-    int wait)
-{
-    unsigned int nr_cpus;
-
-    ASSERT(local_irq_is_enabled());
-
-    spin_lock(&call_lock);
-
-    cpumask_copy(&call_data.selected, selected);
-
-    nr_cpus = cpumask_weight(&call_data.selected);
-    if ( nr_cpus == 0 )
-        goto out;
-
-    call_data.func = func;
-    call_data.info = info;
-    call_data.wait = wait;
-
-    send_IPI_mask(&call_data.selected, CALL_FUNCTION_VECTOR);
+    send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
 
-    if ( cpumask_test_cpu(smp_processor_id(), &call_data.selected) )
+    if ( cpumask_test_cpu(smp_processor_id(), mask) )
     {
         local_irq_disable();
-        __smp_call_function_interrupt();
+        smp_call_function_interrupt();
         local_irq_enable();
     }
-
-    while ( !cpumask_empty(&call_data.selected) )
-        cpu_relax();
-
- out:
-    spin_unlock(&call_lock);
 }
 
 void __stop_this_cpu(void)
@@ -390,36 +339,9 @@ void event_check_interrupt(struct cpu_user_regs *regs)
     this_cpu(irq_count)++;
 }
 
-static void __smp_call_function_interrupt(void)
-{
-    void (*func)(void *info) = call_data.func;
-    void *info = call_data.info;
-    unsigned int cpu = smp_processor_id();
-
-    if ( !cpumask_test_cpu(cpu, &call_data.selected) )
-        return;
-
-    irq_enter();
-
-    if ( call_data.wait )
-    {
-        (*func)(info);
-        mb();
-        cpumask_clear_cpu(cpu, &call_data.selected);
-    }
-    else
-    {
-        mb();
-        cpumask_clear_cpu(cpu, &call_data.selected);
-        (*func)(info);
-    }
-
-    irq_exit();
-}
-
 void call_function_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
     perfc_incr(ipis);
-    __smp_call_function_interrupt();
+    smp_call_function_interrupt();
 }
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 8a0c506..0dc2050 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -26,6 +26,7 @@ obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += sort.o
+obj-y += smp.o
 obj-y += spinlock.o
 obj-y += stop_machine.o
 obj-y += string.o
diff --git a/xen/common/smp.c b/xen/common/smp.c
new file mode 100644
index 0000000..b2b056b
--- /dev/null
+++ b/xen/common/smp.c
@@ -0,0 +1,112 @@
+/*
+ * xen/common/smp.c
+ *
+ * Generic SMP function
+ *
+ * Copyright (c) 2013 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/hardirq.h>
+#include <asm/processor.h>
+#include <xen/spinlock.h>
+#include <xen/smp.h>
+
+/*
+ * Structure and data for smp_call_function()/on_selected_cpus().
+ */
+static DEFINE_SPINLOCK(call_lock);
+static struct call_data_struct {
+    void (*func) (void *info);
+    void *info;
+    int wait;
+    cpumask_t selected;
+} call_data;
+
+void smp_call_function(
+    void (*func) (void *info),
+    void *info,
+    int wait)
+{
+    cpumask_t allbutself;
+
+    cpumask_andnot(&allbutself, &cpu_online_map,
+                   cpumask_of(smp_processor_id()));
+    on_selected_cpus(&allbutself, func, info, wait);
+}
+
+void on_selected_cpus(
+    const cpumask_t *selected,
+    void (*func) (void *info),
+    void *info,
+    int wait)
+{
+    unsigned int nr_cpus;
+
+    ASSERT(local_irq_is_enabled());
+
+    spin_lock(&call_lock);
+
+    cpumask_copy(&call_data.selected, selected);
+
+    nr_cpus = cpumask_weight(&call_data.selected);
+    if ( nr_cpus == 0 )
+        goto out;
+
+    call_data.func = func;
+    call_data.info = info;
+    call_data.wait = wait;
+
+    smp_send_call_function_mask(&call_data.selected);
+
+    while ( !cpumask_empty(&call_data.selected) )
+        cpu_relax();
+
+out:
+    spin_unlock(&call_lock);
+}
+
+void smp_call_function_interrupt(void)
+{
+    void (*func)(void *info) = call_data.func;
+    void *info = call_data.info;
+    unsigned int cpu = smp_processor_id();
+
+    if ( !cpumask_test_cpu(cpu, &call_data.selected) )
+        return;
+
+    irq_enter();
+
+    if ( call_data.wait )
+    {
+        (*func)(info);
+        mb();
+        cpumask_clear_cpu(cpu, &call_data.selected);
+    }
+    else
+    {
+        mb();
+        cpumask_clear_cpu(cpu, &call_data.selected);
+        (*func)(info);
+    }
+
+    irq_exit();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index bf2d0a0..0f9f74b 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -173,6 +173,7 @@ extern void gic_restore_state(struct vcpu *v);
 enum gic_sgi {
     GIC_SGI_EVENT_CHECK = 0,
     GIC_SGI_DUMP_STATE  = 1,
+    GIC_SGI_CALL_FUNCTION = 2,
 };
 extern void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi);
 extern void send_SGI_one(unsigned int cpu, enum gic_sgi sgi);
diff --git a/xen/include/asm-x86/hardirq.h b/xen/include/asm-x86/hardirq.h
index e573007..01a41b9 100644
--- a/xen/include/asm-x86/hardirq.h
+++ b/xen/include/asm-x86/hardirq.h
@@ -3,6 +3,7 @@
 
 #include <xen/config.h>
 #include <xen/cache.h>
+#include <xen/types.h>
 
 typedef struct {
 	unsigned int __softirq_pending;
diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h
index e05f390..6febb56 100644
--- a/xen/include/xen/smp.h
+++ b/xen/include/xen/smp.h
@@ -58,6 +58,13 @@ static inline void on_each_cpu(
     on_selected_cpus(&cpu_online_map, func, info, wait);
 }
 
+/*
+ * Call a function on the current CPU
+ */
+void smp_call_function_interrupt(void);
+
+void smp_send_call_function_mask(const cpumask_t *mask);
+
 #define smp_processor_id() raw_smp_processor_id()
 
 int alloc_cpu_id(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9Xn-0005xC-0h; Wed, 08 May 2013 18:56: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 1Ua9Xl-0005wr-P5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:49 +0000
Received: from [85.158.139.83:15615] by server-11.bemta-5.messagelabs.com id
	58/79-26693-1FF9A815; Wed, 08 May 2013 18:56:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1368039407!27898508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17907 invoked from network); 8 May 2013 18:56:48 -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;
	8 May 2013 18:56: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 1Ua9Xi-0006SR-Vc
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9Xi-0000on-TP
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:46 +0000
Date: Wed, 08 May 2013 18:56:46 +0000
Message-Id: <E1Ua9Xi-0000on-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/gic: EOI irqs on the right pcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fd13be77430baefbc9fd823a60085341242c24d2
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 14:33:08 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:06:26 2013 +0100

    xen/gic: EOI irqs on the right pcpu
    
    We need to write the irq number to GICC_DIR on the physical cpu that
    previously received the interrupt, but currently we are doing it on the
    pcpu that received the maintenance interrupt. As a consequence if a
    vcpu is migrated to a different pcpu, the irq is going to be EOI'ed on
    the wrong pcpu.
    
    This covers the case where dom0 vcpu0 is running on pcpu1 for example
    (you can test this scenario by using xl vcpu-pin).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   23 ++++++++++++++++++++++-
 xen/arch/arm/irq.c        |    1 +
 xen/include/asm-arm/irq.h |    1 +
 3 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1bcb0ca..2a44cf8 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -709,6 +709,12 @@ int gicv_setup(struct domain *d)
                         gic.vbase);
 }
 
+static void gic_irq_eoi(void *info)
+{
+    int virq = (int) info;
+    GICC[GICC_DIR] = virq;
+}
+
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
     int i = 0, virq;
@@ -719,6 +725,10 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
     while ((i = find_next_bit((const long unsigned int *) &eisr,
                               64, i)) < 64) {
         struct pending_irq *p;
+        int cpu, eoi;
+
+        cpu = -1;
+        eoi = 0;
 
         spin_lock_irq(&gic.lock);
         lr = GICH[GICH_LR + i];
@@ -740,11 +750,22 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
         p = irq_to_pending(v, virq);
         if ( p->desc != NULL ) {
             p->desc->status &= ~IRQ_INPROGRESS;
-            GICC[GICC_DIR] = virq;
+            /* Assume only one pcpu needs to EOI the irq */
+            cpu = p->desc->arch.eoi_cpu;
+            eoi = 1;
         }
         list_del_init(&p->inflight);
         spin_unlock_irq(&v->arch.vgic.lock);
 
+        if ( eoi ) {
+            /* this is not racy because we can't receive another irq of the
+             * same type until we EOI it.  */
+            if ( cpu == smp_processor_id() )
+                gic_irq_eoi((void*)virq);
+            else
+                on_selected_cpus(cpumask_of(cpu), gic_irq_eoi, (void*)virq, 0);
+        }
+
         i++;
     }
 }
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 8c96a0a..b2e486f 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -156,6 +156,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
         desc->handler->end(desc);
 
         desc->status |= IRQ_INPROGRESS;
+        desc->arch.eoi_cpu = smp_processor_id();
 
         /* XXX: inject irq into all guest vcpus */
         vgic_vcpu_inject_irq(d->vcpu[0], irq, 0);
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index 9fc008c..eeb733a 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -15,6 +15,7 @@ struct arch_pirq
 
 struct irq_cfg {
 #define arch_irq_desc irq_cfg
+    int eoi_cpu;
 };
 
 #define NR_LOCAL_IRQS	32
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 08 18:56:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 May 2013 18:56: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 1Ua9Xn-0005xC-0h; Wed, 08 May 2013 18:56: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 1Ua9Xl-0005wr-P5
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:49 +0000
Received: from [85.158.139.83:15615] by server-11.bemta-5.messagelabs.com id
	58/79-26693-1FF9A815; Wed, 08 May 2013 18:56:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1368039407!27898508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17907 invoked from network); 8 May 2013 18:56:48 -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;
	8 May 2013 18:56: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 1Ua9Xi-0006SR-Vc
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ua9Xi-0000on-TP
	for xen-changelog@lists.xensource.com; Wed, 08 May 2013 18:56:46 +0000
Date: Wed, 08 May 2013 18:56:46 +0000
Message-Id: <E1Ua9Xi-0000on-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/gic: EOI irqs on the right pcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fd13be77430baefbc9fd823a60085341242c24d2
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue May 7 14:33:08 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:06:26 2013 +0100

    xen/gic: EOI irqs on the right pcpu
    
    We need to write the irq number to GICC_DIR on the physical cpu that
    previously received the interrupt, but currently we are doing it on the
    pcpu that received the maintenance interrupt. As a consequence if a
    vcpu is migrated to a different pcpu, the irq is going to be EOI'ed on
    the wrong pcpu.
    
    This covers the case where dom0 vcpu0 is running on pcpu1 for example
    (you can test this scenario by using xl vcpu-pin).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   23 ++++++++++++++++++++++-
 xen/arch/arm/irq.c        |    1 +
 xen/include/asm-arm/irq.h |    1 +
 3 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1bcb0ca..2a44cf8 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -709,6 +709,12 @@ int gicv_setup(struct domain *d)
                         gic.vbase);
 }
 
+static void gic_irq_eoi(void *info)
+{
+    int virq = (int) info;
+    GICC[GICC_DIR] = virq;
+}
+
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
     int i = 0, virq;
@@ -719,6 +725,10 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
     while ((i = find_next_bit((const long unsigned int *) &eisr,
                               64, i)) < 64) {
         struct pending_irq *p;
+        int cpu, eoi;
+
+        cpu = -1;
+        eoi = 0;
 
         spin_lock_irq(&gic.lock);
         lr = GICH[GICH_LR + i];
@@ -740,11 +750,22 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
         p = irq_to_pending(v, virq);
         if ( p->desc != NULL ) {
             p->desc->status &= ~IRQ_INPROGRESS;
-            GICC[GICC_DIR] = virq;
+            /* Assume only one pcpu needs to EOI the irq */
+            cpu = p->desc->arch.eoi_cpu;
+            eoi = 1;
         }
         list_del_init(&p->inflight);
         spin_unlock_irq(&v->arch.vgic.lock);
 
+        if ( eoi ) {
+            /* this is not racy because we can't receive another irq of the
+             * same type until we EOI it.  */
+            if ( cpu == smp_processor_id() )
+                gic_irq_eoi((void*)virq);
+            else
+                on_selected_cpus(cpumask_of(cpu), gic_irq_eoi, (void*)virq, 0);
+        }
+
         i++;
     }
 }
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 8c96a0a..b2e486f 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -156,6 +156,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
         desc->handler->end(desc);
 
         desc->status |= IRQ_INPROGRESS;
+        desc->arch.eoi_cpu = smp_processor_id();
 
         /* XXX: inject irq into all guest vcpus */
         vgic_vcpu_inject_irq(d->vcpu[0], irq, 0);
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index 9fc008c..eeb733a 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -15,6 +15,7 @@ struct arch_pirq
 
 struct irq_cfg {
 #define arch_irq_desc irq_cfg
+    int eoi_cpu;
 };
 
 #define NR_LOCAL_IRQS	32
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:00:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:00: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 1UaFDW-00054i-Lh; Thu, 09 May 2013 01:00:18 +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 1UaFDU-0004eN-GA
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:16 +0000
Received: from [85.158.139.211:37627] by server-11.bemta-5.messagelabs.com id
	CF/F6-26693-F15FA815; Thu, 09 May 2013 01:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1368061213!22213369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15054 invoked from network); 9 May 2013 01:00: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;
	9 May 2013 01:00: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 1UaFDQ-0003X7-VU
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDN-0001FU-EY
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:10 +0000
Date: Thu, 09 May 2013 01:00:09 +0000
Message-Id: <E1UaFDN-0001FU-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/Linux: add iscsi block hotplug
	script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2607906619652996883=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit bda856e1023868b1e9605e845bedbd8b7ed2944e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu May 2 13:38:55 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:51:30 2013 +0100

    hotplug/Linux: add iscsi block hotplug script
    
    This hotplug script has been tested with IET and NetBSD iSCSI targets,
    without authentication.
    
    This hotplug script will only work with PV guests not using pygrub.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/hotplug/Linux/Makefile    |    1 +
 tools/hotplug/Linux/block-iscsi |  154 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 155 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 99bf87f..8b0d7f4 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -22,6 +22,7 @@ XEN_SCRIPTS += blktap
 XEN_SCRIPTS += xen-hotplug-cleanup
 XEN_SCRIPTS += external-device-migrate
 XEN_SCRIPTS += vscsi
+XEN_SCRIPTS += block-iscsi
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
 XEN_SCRIPT_DATA += block-common.sh
diff --git a/tools/hotplug/Linux/block-iscsi b/tools/hotplug/Linux/block-iscsi
new file mode 100644
index 0000000..8e36852
--- /dev/null
+++ b/tools/hotplug/Linux/block-iscsi
@@ -0,0 +1,154 @@
+#!/bin/bash -e
+#
+# Open-iSCSI Xen block device hotplug script
+#
+# Author Roger Pau Monné <roger.pau@citrix.com>
+#
+# This program 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; version 2.1 only. with the special
+# exception on linking described in file LICENSE.
+#
+# 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 Lesser General Public License for more details.
+#
+# Usage:
+#
+# Target should be specified using the following syntax:
+#
+# script=block-iscsi,vdev=xvda,target=iqn=<iqn>,portal=<portal IP>
+#
+# Portal address must be in IP format.
+#
+
+dir=$(dirname "$0")
+. "$dir/block-common.sh"
+
+remove_label()
+{
+    echo $1 | sed "s/^\("$2"\)//"
+}
+
+check_tools()
+{
+    if ! command -v iscsiadm > /dev/null 2>&1; then
+        fatal "Unable to find iscsiadm tool"
+    fi
+    if [ "$multipath" = "y" ] && ! command -v multipath > /dev/null 2>&1; then
+        fatal "Unable to find multipath"
+    fi
+}
+
+# Sets the following global variables based on the params field passed in as
+# a parameter: iqn, portal, auth_method, user, multipath, password
+parse_target()
+{
+    # set multipath default value
+    multipath="n"
+    for param in $(echo "$1" | tr "," "\n")
+    do
+        case $param in
+        iqn=*)
+            iqn=$(remove_label $param "iqn=")
+            ;;
+        portal=*)
+            portal=$(remove_label $param "portal=")
+            ;;
+        multipath=*)
+            multipath=$(remove_label $param "multipath=")
+            ;;
+        esac
+    done
+    if [ -z "$iqn" ] || [ -z "$portal" ]; then
+        fatal "iqn= and portal= are required parameters"
+    fi
+    if [ "$multipath" != "y" ] && [ "$multipath" != "n" ]; then
+        fatal "multipath valid values are y and n, $multipath not a valid value"
+    fi
+}
+
+# Sets $dev to point to the device associated with the value in iqn
+find_device()
+{
+    count=0
+    while [ ! -e /dev/disk/by-path/*"$iqn"-lun-0 ]; do
+        sleep 0.1
+        count=`expr $count + 1`
+        if [ count = 100 ]; then
+            # 10s timeout while waiting for iSCSI disk to settle
+            fatal "timeout waiting for iSCSI disk to settle"
+        fi
+    done
+    sddev=$(readlink -f /dev/disk/by-path/*"$iqn"-lun-0 || true)
+    if [ ! -b "$sddev" ]; then
+        fatal "Unable to find attached device path"
+    fi
+    if [ "$multipath" = "y" ]; then
+        mdev=$(multipath -ll "$sddev" | head -1 | awk '{ print $1}')
+        if [ ! -b /dev/mapper/"$mdev" ]; then
+            fatal "Unable to find attached device multipath"
+        fi
+        dev="/dev/mapper/$mdev"
+    else
+        dev="$sddev"
+    fi
+}
+
+# Attaches the target $iqn in $portal and sets $dev to point to the
+# multipath device
+attach()
+{
+    do_or_die iscsiadm -m node --targetname "$iqn" -p "$portal" --login > /dev/null
+    find_device
+}
+
+# Discovers targets in $portal and checks that $iqn is one of those targets
+# Also sets the auth parameters to attach the device
+prepare()
+{
+    # Check if target is already opened
+    iscsiadm -m session 2>&1 | grep -q "$iqn" && fatal "Device already opened"
+    # Discover portal targets
+    iscsiadm -m discovery -t st -p $portal 2>&1 | grep -q "$iqn" || \
+        fatal "No matching target iqn found"
+}
+
+# Attaches the device and writes xenstore backend entries to connect
+# the device
+add()
+{
+    attach
+    write_dev $dev
+}
+
+# Disconnects the device
+remove()
+{
+    find_device
+    do_or_die iscsiadm -m node --targetname "$iqn" -p "$portal" --logout > /dev/null
+}
+
+command=$1
+target=$(xenstore-read $XENBUS_PATH/params || true)
+if [ -z "$target" ]; then
+    fatal "No information about the target"
+fi
+
+parse_target "$target"
+
+check_tools || exit 1
+
+case $command in
+add)
+    prepare
+    add
+    ;;
+remove)
+    remove
+    ;;
+*)
+    exit 1
+    ;;
+esac
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2607906619652996883==
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
--===============2607906619652996883==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:00:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:00: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 1UaFDW-00054i-Lh; Thu, 09 May 2013 01:00:18 +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 1UaFDU-0004eN-GA
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:16 +0000
Received: from [85.158.139.211:37627] by server-11.bemta-5.messagelabs.com id
	CF/F6-26693-F15FA815; Thu, 09 May 2013 01:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1368061213!22213369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15054 invoked from network); 9 May 2013 01:00: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;
	9 May 2013 01:00: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 1UaFDQ-0003X7-VU
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDN-0001FU-EY
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:10 +0000
Date: Thu, 09 May 2013 01:00:09 +0000
Message-Id: <E1UaFDN-0001FU-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/Linux: add iscsi block hotplug
	script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2607906619652996883=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit bda856e1023868b1e9605e845bedbd8b7ed2944e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu May 2 13:38:55 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:51:30 2013 +0100

    hotplug/Linux: add iscsi block hotplug script
    
    This hotplug script has been tested with IET and NetBSD iSCSI targets,
    without authentication.
    
    This hotplug script will only work with PV guests not using pygrub.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/hotplug/Linux/Makefile    |    1 +
 tools/hotplug/Linux/block-iscsi |  154 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 155 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 99bf87f..8b0d7f4 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -22,6 +22,7 @@ XEN_SCRIPTS += blktap
 XEN_SCRIPTS += xen-hotplug-cleanup
 XEN_SCRIPTS += external-device-migrate
 XEN_SCRIPTS += vscsi
+XEN_SCRIPTS += block-iscsi
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
 XEN_SCRIPT_DATA += block-common.sh
diff --git a/tools/hotplug/Linux/block-iscsi b/tools/hotplug/Linux/block-iscsi
new file mode 100644
index 0000000..8e36852
--- /dev/null
+++ b/tools/hotplug/Linux/block-iscsi
@@ -0,0 +1,154 @@
+#!/bin/bash -e
+#
+# Open-iSCSI Xen block device hotplug script
+#
+# Author Roger Pau Monné <roger.pau@citrix.com>
+#
+# This program 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; version 2.1 only. with the special
+# exception on linking described in file LICENSE.
+#
+# 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 Lesser General Public License for more details.
+#
+# Usage:
+#
+# Target should be specified using the following syntax:
+#
+# script=block-iscsi,vdev=xvda,target=iqn=<iqn>,portal=<portal IP>
+#
+# Portal address must be in IP format.
+#
+
+dir=$(dirname "$0")
+. "$dir/block-common.sh"
+
+remove_label()
+{
+    echo $1 | sed "s/^\("$2"\)//"
+}
+
+check_tools()
+{
+    if ! command -v iscsiadm > /dev/null 2>&1; then
+        fatal "Unable to find iscsiadm tool"
+    fi
+    if [ "$multipath" = "y" ] && ! command -v multipath > /dev/null 2>&1; then
+        fatal "Unable to find multipath"
+    fi
+}
+
+# Sets the following global variables based on the params field passed in as
+# a parameter: iqn, portal, auth_method, user, multipath, password
+parse_target()
+{
+    # set multipath default value
+    multipath="n"
+    for param in $(echo "$1" | tr "," "\n")
+    do
+        case $param in
+        iqn=*)
+            iqn=$(remove_label $param "iqn=")
+            ;;
+        portal=*)
+            portal=$(remove_label $param "portal=")
+            ;;
+        multipath=*)
+            multipath=$(remove_label $param "multipath=")
+            ;;
+        esac
+    done
+    if [ -z "$iqn" ] || [ -z "$portal" ]; then
+        fatal "iqn= and portal= are required parameters"
+    fi
+    if [ "$multipath" != "y" ] && [ "$multipath" != "n" ]; then
+        fatal "multipath valid values are y and n, $multipath not a valid value"
+    fi
+}
+
+# Sets $dev to point to the device associated with the value in iqn
+find_device()
+{
+    count=0
+    while [ ! -e /dev/disk/by-path/*"$iqn"-lun-0 ]; do
+        sleep 0.1
+        count=`expr $count + 1`
+        if [ count = 100 ]; then
+            # 10s timeout while waiting for iSCSI disk to settle
+            fatal "timeout waiting for iSCSI disk to settle"
+        fi
+    done
+    sddev=$(readlink -f /dev/disk/by-path/*"$iqn"-lun-0 || true)
+    if [ ! -b "$sddev" ]; then
+        fatal "Unable to find attached device path"
+    fi
+    if [ "$multipath" = "y" ]; then
+        mdev=$(multipath -ll "$sddev" | head -1 | awk '{ print $1}')
+        if [ ! -b /dev/mapper/"$mdev" ]; then
+            fatal "Unable to find attached device multipath"
+        fi
+        dev="/dev/mapper/$mdev"
+    else
+        dev="$sddev"
+    fi
+}
+
+# Attaches the target $iqn in $portal and sets $dev to point to the
+# multipath device
+attach()
+{
+    do_or_die iscsiadm -m node --targetname "$iqn" -p "$portal" --login > /dev/null
+    find_device
+}
+
+# Discovers targets in $portal and checks that $iqn is one of those targets
+# Also sets the auth parameters to attach the device
+prepare()
+{
+    # Check if target is already opened
+    iscsiadm -m session 2>&1 | grep -q "$iqn" && fatal "Device already opened"
+    # Discover portal targets
+    iscsiadm -m discovery -t st -p $portal 2>&1 | grep -q "$iqn" || \
+        fatal "No matching target iqn found"
+}
+
+# Attaches the device and writes xenstore backend entries to connect
+# the device
+add()
+{
+    attach
+    write_dev $dev
+}
+
+# Disconnects the device
+remove()
+{
+    find_device
+    do_or_die iscsiadm -m node --targetname "$iqn" -p "$portal" --logout > /dev/null
+}
+
+command=$1
+target=$(xenstore-read $XENBUS_PATH/params || true)
+if [ -z "$target" ]; then
+    fatal "No information about the target"
+fi
+
+parse_target "$target"
+
+check_tools || exit 1
+
+case $command in
+add)
+    prepare
+    add
+    ;;
+remove)
+    remove
+    ;;
+*)
+    exit 1
+    ;;
+esac
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2607906619652996883==
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
--===============2607906619652996883==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:00:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:00:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UaFDf-0006Ll-Ok; Thu, 09 May 2013 01:00: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 1UaFDe-000698-Mb
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:26 +0000
Received: from [85.158.143.99:49671] by server-2.bemta-4.messagelabs.com id
	3C/75-27124-925FA815; Thu, 09 May 2013 01:00:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1368061223!23065388!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1880 invoked from network); 9 May 2013 01:00:24 -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;
	9 May 2013 01:00: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 1UaFDb-0004lK-FX
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDb-0001Ft-9w
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:23 +0000
Date: Thu, 09 May 2013 01:00:23 +0000
Message-Id: <E1UaFDb-0001Ft-9w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: canonicalize representation of
	boolean type in xl.cfg
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dd4409a8e9cf56d1d0bb30b25483df31aee9336e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 7 12:28:54 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:58:44 2013 +0100

    docs: canonicalize representation of boolean type in xl.cfg
    
    The representations of boolean type in xl docs are inconsistent. This patch
    replaces occurences of "1", "0", "[Tt]rue" and "[Ff]alse" with "[Tt]rue (1)"
    and "[Ff]alse (0)".
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5 |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index f8b4576..e0c3bb2 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -460,12 +460,13 @@ Specifies that MSI-INTx translation should be turned on for the PCI
 device. When enabled, MSI-INTx translation will always enable MSI on
 the PCI device regardless whether the guest uses INTx or MSI. Some
 device drivers, such as NVIDIA's, detect an inconsistency and do not
-function when this option is enabled. Therefore the default is 0.
+function when this option is enabled. Therefore the default is false (0).
 
 =item B<power_mgmt=BOOLEAN>
 
 (HVM only) Specifies that the VM should be able to program the
-D0-D3hot power management states for the PCI device. 0 by default.
+D0-D3hot power management states for the PCI device. False (0) by
+default.
 
 =back
 
@@ -600,7 +601,7 @@ specific what meaning this has).
 =item B<e820_host=BOOLEAN>
 
 Selects whether to expose the host e820 (memory map) to the guest via
-the virtual e820. When this option is false the guest pseudo-physical
+the virtual e820. When this option is false (0) the guest pseudo-physical
 address space consists of a single contiguous RAM region. When this
 option is specified the virtual e820 instead reflects the host e820
 and contains the same PCI holes. The total amount of RAM represented
@@ -612,8 +613,8 @@ opportunity to set aside the required part of its pseudo-physical
 address space in order to provide address space to map passedthrough
 PCI devices. It is guest Operating System dependent whether this
 option is required, specifically it is required when using a mainline
-Linux ("pvops") kernel. This option defaults to true if any PCI
-passthrough devices are configured and false otherwise. If you do not
+Linux ("pvops") kernel. This option defaults to true (1) if any PCI
+passthrough devices are configured and false (0) otherwise. If you do not
 configure any passthrough devices at domain creation time but expect
 to hotplug devices later then you should set this option. Conversely
 if your particular guest kernel does not require this behaviour then
@@ -737,12 +738,12 @@ disable ACPI for compatibility with some guest Operating Systems.
 =item B<acpi_s3=BOOLEAN>
 
 Include the S3 (suspend-to-ram) power state in the virtual firmware
-ACPI table. 1 by default.
+ACPI table. True (1) by default.
 
 =item B<acpi_s4=BOOLEAN>
 
 Include S4 (suspend-to-disk) power state in the virtual firmware ACPI
-table. 1 by default.
+table. True (1) by default.
 
 =item B<apic=BOOLEAN>
 
@@ -895,11 +896,12 @@ Please see F<docs/misc/tscmode.txt> for more information on this option.
 
 =item B<localtime=BOOLEAN>
 
-Set the real time clock to local time or to UTC. 0 by default, i.e. set to UTC.
+Set the real time clock to local time or to UTC. False (0) by default,
+i.e. set to UTC.
 
 =item B<rtc_timeoffset=SECONDS>
 
-Set the real time clock offset in seconds. 0 by default.
+Set the real time clock offset in seconds. False (0) by default.
 
 
 =item B<vpt_align=BOOLEAN>
@@ -907,7 +909,7 @@ Set the real time clock offset in seconds. 0 by default.
 Specifies that periodic Virtual Platform Timers should be aligned to
 reduce guest interrupts. Enabling this option can reduce power
 consumption, especially when a guest uses a high timer interrupt
-frequency (HZ) values. The default is 1.
+frequency (HZ) values. The default is true (1).
 
 =item B<timer_mode=MODE>
 
@@ -1009,7 +1011,7 @@ If B<videoram> is set less than 128MB, an error will be triggered.
 =item B<stdvga=BOOLEAN>
 
 Select a standard VGA card with VBE (VESA BIOS Extensions) as the
-emulated graphics device. The default is false which means to emulate
+emulated graphics device. The default is false (0) which means to emulate
 a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
 later (e.g. Windows XP onwards) then you should enable this.
 stdvga supports more video ram and bigger resolutions than Cirrus.
@@ -1071,7 +1073,7 @@ Simple DirectMedia Layer). The default is not to enable this mode.
 
 Enable OpenGL acceleration of the SDL display. Only effects machines
 using B<device_model_version="qemu-xen-traditional"> and only if the
-device-model was compiled with OpenGL support. 0 by default.
+device-model was compiled with OpenGL support. False (0) by default.
 
 =item B<nographic=BOOLEAN>
 
@@ -1112,7 +1114,7 @@ have not been supported.
 =item B<spicedisable_ticketing=BOOLEAN>
 
 Enable client connection without password. When disabled, spicepasswd
-must be set. The default is 0.
+must be set. The default is false (0).
 
 =item B<spicepasswd="PASSWORD">
 
@@ -1120,7 +1122,7 @@ Specify the ticket password which is used by a client for connection.
 
 =item B<spiceagent_mouse=BOOLEAN>
 
-Whether SPICE agent is used for client mouse mode. The default is true
+Whether SPICE agent is used for client mouse mode. The default is true (1)
 (turn on)
 
 =back
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:00:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:00:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UaFDf-0006Ll-Ok; Thu, 09 May 2013 01:00: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 1UaFDe-000698-Mb
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:26 +0000
Received: from [85.158.143.99:49671] by server-2.bemta-4.messagelabs.com id
	3C/75-27124-925FA815; Thu, 09 May 2013 01:00:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1368061223!23065388!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1880 invoked from network); 9 May 2013 01:00:24 -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;
	9 May 2013 01:00: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 1UaFDb-0004lK-FX
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDb-0001Ft-9w
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:23 +0000
Date: Thu, 09 May 2013 01:00:23 +0000
Message-Id: <E1UaFDb-0001Ft-9w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: canonicalize representation of
	boolean type in xl.cfg
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dd4409a8e9cf56d1d0bb30b25483df31aee9336e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 7 12:28:54 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 11:58:44 2013 +0100

    docs: canonicalize representation of boolean type in xl.cfg
    
    The representations of boolean type in xl docs are inconsistent. This patch
    replaces occurences of "1", "0", "[Tt]rue" and "[Ff]alse" with "[Tt]rue (1)"
    and "[Ff]alse (0)".
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5 |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index f8b4576..e0c3bb2 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -460,12 +460,13 @@ Specifies that MSI-INTx translation should be turned on for the PCI
 device. When enabled, MSI-INTx translation will always enable MSI on
 the PCI device regardless whether the guest uses INTx or MSI. Some
 device drivers, such as NVIDIA's, detect an inconsistency and do not
-function when this option is enabled. Therefore the default is 0.
+function when this option is enabled. Therefore the default is false (0).
 
 =item B<power_mgmt=BOOLEAN>
 
 (HVM only) Specifies that the VM should be able to program the
-D0-D3hot power management states for the PCI device. 0 by default.
+D0-D3hot power management states for the PCI device. False (0) by
+default.
 
 =back
 
@@ -600,7 +601,7 @@ specific what meaning this has).
 =item B<e820_host=BOOLEAN>
 
 Selects whether to expose the host e820 (memory map) to the guest via
-the virtual e820. When this option is false the guest pseudo-physical
+the virtual e820. When this option is false (0) the guest pseudo-physical
 address space consists of a single contiguous RAM region. When this
 option is specified the virtual e820 instead reflects the host e820
 and contains the same PCI holes. The total amount of RAM represented
@@ -612,8 +613,8 @@ opportunity to set aside the required part of its pseudo-physical
 address space in order to provide address space to map passedthrough
 PCI devices. It is guest Operating System dependent whether this
 option is required, specifically it is required when using a mainline
-Linux ("pvops") kernel. This option defaults to true if any PCI
-passthrough devices are configured and false otherwise. If you do not
+Linux ("pvops") kernel. This option defaults to true (1) if any PCI
+passthrough devices are configured and false (0) otherwise. If you do not
 configure any passthrough devices at domain creation time but expect
 to hotplug devices later then you should set this option. Conversely
 if your particular guest kernel does not require this behaviour then
@@ -737,12 +738,12 @@ disable ACPI for compatibility with some guest Operating Systems.
 =item B<acpi_s3=BOOLEAN>
 
 Include the S3 (suspend-to-ram) power state in the virtual firmware
-ACPI table. 1 by default.
+ACPI table. True (1) by default.
 
 =item B<acpi_s4=BOOLEAN>
 
 Include S4 (suspend-to-disk) power state in the virtual firmware ACPI
-table. 1 by default.
+table. True (1) by default.
 
 =item B<apic=BOOLEAN>
 
@@ -895,11 +896,12 @@ Please see F<docs/misc/tscmode.txt> for more information on this option.
 
 =item B<localtime=BOOLEAN>
 
-Set the real time clock to local time or to UTC. 0 by default, i.e. set to UTC.
+Set the real time clock to local time or to UTC. False (0) by default,
+i.e. set to UTC.
 
 =item B<rtc_timeoffset=SECONDS>
 
-Set the real time clock offset in seconds. 0 by default.
+Set the real time clock offset in seconds. False (0) by default.
 
 
 =item B<vpt_align=BOOLEAN>
@@ -907,7 +909,7 @@ Set the real time clock offset in seconds. 0 by default.
 Specifies that periodic Virtual Platform Timers should be aligned to
 reduce guest interrupts. Enabling this option can reduce power
 consumption, especially when a guest uses a high timer interrupt
-frequency (HZ) values. The default is 1.
+frequency (HZ) values. The default is true (1).
 
 =item B<timer_mode=MODE>
 
@@ -1009,7 +1011,7 @@ If B<videoram> is set less than 128MB, an error will be triggered.
 =item B<stdvga=BOOLEAN>
 
 Select a standard VGA card with VBE (VESA BIOS Extensions) as the
-emulated graphics device. The default is false which means to emulate
+emulated graphics device. The default is false (0) which means to emulate
 a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
 later (e.g. Windows XP onwards) then you should enable this.
 stdvga supports more video ram and bigger resolutions than Cirrus.
@@ -1071,7 +1073,7 @@ Simple DirectMedia Layer). The default is not to enable this mode.
 
 Enable OpenGL acceleration of the SDL display. Only effects machines
 using B<device_model_version="qemu-xen-traditional"> and only if the
-device-model was compiled with OpenGL support. 0 by default.
+device-model was compiled with OpenGL support. False (0) by default.
 
 =item B<nographic=BOOLEAN>
 
@@ -1112,7 +1114,7 @@ have not been supported.
 =item B<spicedisable_ticketing=BOOLEAN>
 
 Enable client connection without password. When disabled, spicepasswd
-must be set. The default is 0.
+must be set. The default is false (0).
 
 =item B<spicepasswd="PASSWORD">
 
@@ -1120,7 +1122,7 @@ Specify the ticket password which is used by a client for connection.
 
 =item B<spiceagent_mouse=BOOLEAN>
 
-Whether SPICE agent is used for client mouse mode. The default is true
+Whether SPICE agent is used for client mouse mode. The default is true (1)
 (turn on)
 
 =back
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:00:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01: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 1UaFDp-0007y4-Rj; Thu, 09 May 2013 01:00: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 1UaFDo-0007ik-RL
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:37 +0000
Received: from [85.158.139.83:41472] by server-16.bemta-5.messagelabs.com id
	C1/DF-31493-435FA815; Thu, 09 May 2013 01:00:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1368061234!31916504!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21028 invoked from network); 9 May 2013 01:00:35 -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;
	9 May 2013 01:00: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 1UaFDl-0006JI-NR
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDl-0001GJ-Kf
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:33 +0000
Date: Thu, 09 May 2013 01:00:33 +0000
Message-Id: <E1UaFDl-0001GJ-Kf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correctly parse storage devices
	on driver domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0754632429474805917=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 846bd69104e5d62f29b7282419827e52e99f3efd
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 3 13:23:01 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:06:41 2013 +0100

    libxl: correctly parse storage devices on driver domains
    
    Don't try to check physical devices if they belong to a domain
    different than the one where the toolstack is running. This prevents
    the following error when trying to use storage driver domains:
    
    libxl: debug: libxl_create.c:1246:do_domain_create: ao 0x1819240: create: how=(nil) callback=(nil) poller=0x1818fa0
    libxl: debug: libxl_device.c:235:libxl__device_disk_set_backend: Disk vdev=xvda spec.backend=phy
    libxl: debug: libxl_device.c:175:disk_try_backend: Disk vdev=xvda, backend phy unsuitable as phys path not a block device
    libxl: error: libxl_device.c:278:libxl__device_disk_set_backend: no suitable backend for disk xvda
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index a5cf446..b1fc4ef 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -161,6 +161,12 @@ static int disk_try_backend(disk_try_backend_args *a,
             goto bad_format;
         }
 
+        if (a->disk->backend_domid != LIBXL_TOOLSTACK_DOMID) {
+            LOG(DEBUG, "Disk vdev=%s, is using a storage driver domain, "
+                       "skipping physical device check", a->disk->vdev);
+            return backend;
+        }
+
         if (a->disk->script) {
             LOG(DEBUG, "Disk vdev=%s, uses script=... assuming phy backend",
                 a->disk->vdev);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============0754632429474805917==
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
--===============0754632429474805917==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:00:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01: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 1UaFDp-0007y4-Rj; Thu, 09 May 2013 01:00: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 1UaFDo-0007ik-RL
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:37 +0000
Received: from [85.158.139.83:41472] by server-16.bemta-5.messagelabs.com id
	C1/DF-31493-435FA815; Thu, 09 May 2013 01:00:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1368061234!31916504!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21028 invoked from network); 9 May 2013 01:00:35 -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;
	9 May 2013 01:00: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 1UaFDl-0006JI-NR
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDl-0001GJ-Kf
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:33 +0000
Date: Thu, 09 May 2013 01:00:33 +0000
Message-Id: <E1UaFDl-0001GJ-Kf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correctly parse storage devices
	on driver domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0754632429474805917=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 846bd69104e5d62f29b7282419827e52e99f3efd
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 3 13:23:01 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:06:41 2013 +0100

    libxl: correctly parse storage devices on driver domains
    
    Don't try to check physical devices if they belong to a domain
    different than the one where the toolstack is running. This prevents
    the following error when trying to use storage driver domains:
    
    libxl: debug: libxl_create.c:1246:do_domain_create: ao 0x1819240: create: how=(nil) callback=(nil) poller=0x1818fa0
    libxl: debug: libxl_device.c:235:libxl__device_disk_set_backend: Disk vdev=xvda spec.backend=phy
    libxl: debug: libxl_device.c:175:disk_try_backend: Disk vdev=xvda, backend phy unsuitable as phys path not a block device
    libxl: error: libxl_device.c:278:libxl__device_disk_set_backend: no suitable backend for disk xvda
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index a5cf446..b1fc4ef 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -161,6 +161,12 @@ static int disk_try_backend(disk_try_backend_args *a,
             goto bad_format;
         }
 
+        if (a->disk->backend_domid != LIBXL_TOOLSTACK_DOMID) {
+            LOG(DEBUG, "Disk vdev=%s, is using a storage driver domain, "
+                       "skipping physical device check", a->disk->vdev);
+            return backend;
+        }
+
         if (a->disk->script) {
             LOG(DEBUG, "Disk vdev=%s, uses script=... assuming phy backend",
                 a->disk->vdev);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============0754632429474805917==
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
--===============0754632429474805917==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEA-0002dd-CA; Thu, 09 May 2013 01:00: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 1UaFE8-0002HK-I8
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:56 +0000
Received: from [85.158.143.99:50680] by server-3.bemta-4.messagelabs.com id
	E7/E7-02015-745FA815; Thu, 09 May 2013 01:00:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1368061254!31181095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18660 invoked from network); 9 May 2013 01:00:55 -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;
	9 May 2013 01:00: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 1UaFE6-0000fT-4Z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFE6-0001HW-2Z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:54 +0000
Date: Thu, 09 May 2013 01:00:54 +0000
Message-Id: <E1UaFE6-0001HW-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't write physical-device
	node for driver domain disks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7649050600326146531=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit f0499a0c256a248155d3edb0069fad16a738f473
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 3 13:23:03 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:06:59 2013 +0100

    libxl: don't write physical-device node for driver domain disks
    
    This will be handled by the driver domain itself, since the toolstack
    does not have access to the physical device because it is in a
    different domain.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 87bda72..bc91fd5 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2104,7 +2104,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                  * responsible for this since the block device may not
                  * exist yet.
                  */
-                if (!disk->script) {
+                if (!disk->script &&
+                    disk->backend_domid == LIBXL_TOOLSTACK_DOMID) {
                     int major, minor;
                     libxl__device_physdisk_major_minor(dev, &major, &minor);
                     flexarray_append_pair(back, "physical-device",
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============7649050600326146531==
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
--===============7649050600326146531==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEA-0002dd-CA; Thu, 09 May 2013 01:00: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 1UaFE8-0002HK-I8
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:56 +0000
Received: from [85.158.143.99:50680] by server-3.bemta-4.messagelabs.com id
	E7/E7-02015-745FA815; Thu, 09 May 2013 01:00:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1368061254!31181095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18660 invoked from network); 9 May 2013 01:00:55 -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;
	9 May 2013 01:00: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 1UaFE6-0000fT-4Z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFE6-0001HW-2Z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:54 +0000
Date: Thu, 09 May 2013 01:00:54 +0000
Message-Id: <E1UaFE6-0001HW-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't write physical-device
	node for driver domain disks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7649050600326146531=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit f0499a0c256a248155d3edb0069fad16a738f473
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 3 13:23:03 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:06:59 2013 +0100

    libxl: don't write physical-device node for driver domain disks
    
    This will be handled by the driver domain itself, since the toolstack
    does not have access to the physical device because it is in a
    different domain.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 87bda72..bc91fd5 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2104,7 +2104,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                  * responsible for this since the block device may not
                  * exist yet.
                  */
-                if (!disk->script) {
+                if (!disk->script &&
+                    disk->backend_domid == LIBXL_TOOLSTACK_DOMID) {
                     int major, minor;
                     libxl__device_physdisk_major_minor(dev, &major, &minor);
                     flexarray_append_pair(back, "physical-device",
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============7649050600326146531==
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
--===============7649050600326146531==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEB-0002oI-GN; Thu, 09 May 2013 01:00: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 1UaFEA-0002XX-9v
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:58 +0000
Received: from [85.158.139.211:18229] by server-5.bemta-5.messagelabs.com id
	F6/6A-06980-945FA815; Thu, 09 May 2013 01:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1368061244!22329253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9407 invoked from network); 9 May 2013 01:00:45 -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;
	9 May 2013 01:00:45 -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 1UaFDv-0007jV-UF
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDv-0001Go-Sj
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:43 +0000
Date: Thu, 09 May 2013 01:00:43 +0000
Message-Id: <E1UaFDv-0001Go-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't execute hotplug scripts
	if device is on a driver domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0101386412102812790=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 05bfd984dfe7014f1f5ea1133608b9bab589c120
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 3 13:23:02 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:06:55 2013 +0100

    libxl: don't execute hotplug scripts if device is on a driver domain
    
    Prevent hotplug script execution from libxl if device is on a
    different domain.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index b1fc4ef..bc86648 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -903,6 +903,13 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
     int hotplug;
     pid_t pid;
 
+    /*
+     * If device is attached from a driver domain don't try to execute
+     * hotplug scripts
+     */
+    if (aodev->dev->backend_domid != LIBXL_TOOLSTACK_DOMID)
+        goto out;
+
     /* Check if we have to execute hotplug scripts for this device
      * and return the necessary args/env vars for execution */
     hotplug = libxl__get_hotplug_script_info(gc, aodev->dev, &args, &env,
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============0101386412102812790==
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
--===============0101386412102812790==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEB-0002oI-GN; Thu, 09 May 2013 01:00: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 1UaFEA-0002XX-9v
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:58 +0000
Received: from [85.158.139.211:18229] by server-5.bemta-5.messagelabs.com id
	F6/6A-06980-945FA815; Thu, 09 May 2013 01:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1368061244!22329253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9407 invoked from network); 9 May 2013 01:00:45 -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;
	9 May 2013 01:00:45 -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 1UaFDv-0007jV-UF
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFDv-0001Go-Sj
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:00:43 +0000
Date: Thu, 09 May 2013 01:00:43 +0000
Message-Id: <E1UaFDv-0001Go-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't execute hotplug scripts
	if device is on a driver domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0101386412102812790=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 05bfd984dfe7014f1f5ea1133608b9bab589c120
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 3 13:23:02 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:06:55 2013 +0100

    libxl: don't execute hotplug scripts if device is on a driver domain
    
    Prevent hotplug script execution from libxl if device is on a
    different domain.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index b1fc4ef..bc86648 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -903,6 +903,13 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
     int hotplug;
     pid_t pid;
 
+    /*
+     * If device is attached from a driver domain don't try to execute
+     * hotplug scripts
+     */
+    if (aodev->dev->backend_domid != LIBXL_TOOLSTACK_DOMID)
+        goto out;
+
     /* Check if we have to execute hotplug scripts for this device
      * and return the necessary args/env vars for execution */
     hotplug = libxl__get_hotplug_script_info(gc, aodev->dev, &args, &env,
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============0101386412102812790==
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
--===============0101386412102812790==--

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEK-0004BL-OC; Thu, 09 May 2013 01:01: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 1UaFEJ-0003v0-Hi
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:07 +0000
Received: from [85.158.143.99:51052] by server-2.bemta-4.messagelabs.com id
	FA/A5-27124-255FA815; Thu, 09 May 2013 01:01:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1368061265!26800949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10924 invoked from network); 9 May 2013 01:01:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	9 May 2013 01:01: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 1UaFEH-0002XF-6I
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEG-0001Ii-9B
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:04 +0000
Date: Thu, 09 May 2013 01:01:04 +0000
Message-Id: <E1UaFEG-0001Ii-9B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/debugger/kdd: Remove
	dependencies files during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 38bdfb9197b93262248ff489eed336d80db52b54
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:38 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:30 2013 +0100

    tools/debugger/kdd: Remove dependencies files during make clean
    
    Remove dependencies files during make clean.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/debugger/kdd/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index 8b50766..b569749 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -14,7 +14,7 @@ kdd: $(OBJS)
 
 .PHONY: clean
 clean:
-	rm -f $(OBJS) kdd
+	rm -f $(OBJS) $(DEPS) kdd
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEK-0004BL-OC; Thu, 09 May 2013 01:01: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 1UaFEJ-0003v0-Hi
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:07 +0000
Received: from [85.158.143.99:51052] by server-2.bemta-4.messagelabs.com id
	FA/A5-27124-255FA815; Thu, 09 May 2013 01:01:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1368061265!26800949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10924 invoked from network); 9 May 2013 01:01:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	9 May 2013 01:01: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 1UaFEH-0002XF-6I
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEG-0001Ii-9B
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:04 +0000
Date: Thu, 09 May 2013 01:01:04 +0000
Message-Id: <E1UaFEG-0001Ii-9B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/debugger/kdd: Remove
	dependencies files during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 38bdfb9197b93262248ff489eed336d80db52b54
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:38 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:30 2013 +0100

    tools/debugger/kdd: Remove dependencies files during make clean
    
    Remove dependencies files during make clean.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/debugger/kdd/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index 8b50766..b569749 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -14,7 +14,7 @@ kdd: $(OBJS)
 
 .PHONY: clean
 clean:
-	rm -f $(OBJS) kdd
+	rm -f $(OBJS) $(DEPS) kdd
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEY-0006Mm-RH; Thu, 09 May 2013 01:01: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 1UaFEX-0005zf-1W
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:21 +0000
Received: from [85.158.138.51:45227] by server-5.bemta-3.messagelabs.com id
	20/2B-29713-D55FA815; Thu, 09 May 2013 01:01:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1368061275!18694746!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2775 invoked from network); 9 May 2013 01:01:16 -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;
	9 May 2013 01:01: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 1UaFER-0003p4-Ft
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFER-0001JI-Dg
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:15 +0000
Date: Thu, 09 May 2013 01:01:15 +0000
Message-Id: <E1UaFER-0001JI-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenmon: Fix typo in Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ea5e515ba19c423e15ca33023cd3c9d2c9aa807f
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:39 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:32 2013 +0100

    tools/xenmon: Fix typo in Makefile
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenmon/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile
index 5648075..3fe87ba 100644
--- a/tools/xenmon/Makefile
+++ b/tools/xenmon/Makefile
@@ -38,7 +38,7 @@ install: build
 clean:
 	$(RM) -f $(DEPS)
 	$(RM) -f xenbaked xenbaked.o
-	$(RM) -f xentrace_setmake setmask.o
+	$(RM) -f xentrace_setmask setmask.o
 
 xenbaked: xenbaked.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEY-0006Mm-RH; Thu, 09 May 2013 01:01: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 1UaFEX-0005zf-1W
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:21 +0000
Received: from [85.158.138.51:45227] by server-5.bemta-3.messagelabs.com id
	20/2B-29713-D55FA815; Thu, 09 May 2013 01:01:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1368061275!18694746!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2775 invoked from network); 9 May 2013 01:01:16 -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;
	9 May 2013 01:01: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 1UaFER-0003p4-Ft
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFER-0001JI-Dg
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:15 +0000
Date: Thu, 09 May 2013 01:01:15 +0000
Message-Id: <E1UaFER-0001JI-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenmon: Fix typo in Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ea5e515ba19c423e15ca33023cd3c9d2c9aa807f
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:39 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:32 2013 +0100

    tools/xenmon: Fix typo in Makefile
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenmon/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile
index 5648075..3fe87ba 100644
--- a/tools/xenmon/Makefile
+++ b/tools/xenmon/Makefile
@@ -38,7 +38,7 @@ install: build
 clean:
 	$(RM) -f $(DEPS)
 	$(RM) -f xenbaked xenbaked.o
-	$(RM) -f xentrace_setmake setmask.o
+	$(RM) -f xentrace_setmask setmask.o
 
 xenbaked: xenbaked.o Makefile
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEf-0007MO-UJ; Thu, 09 May 2013 01:01:29 +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 1UaFEe-000768-FO
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:28 +0000
Received: from [85.158.139.83:62832] by server-7.bemta-5.messagelabs.com id
	C9/C1-12828-765FA815; Thu, 09 May 2013 01:01:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1368061285!32000339!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16831 invoked from network); 9 May 2013 01:01:26 -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;
	9 May 2013 01:01:26 -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 1UaFEb-0005XO-Os
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEb-0001Jj-Ks
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:25 +0000
Date: Thu, 09 May 2013 01:01:25 +0000
Message-Id: <E1UaFEb-0001Jj-Ks@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstat/libxenstat: Remove
	src/libxenstat.a file during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 03b90b005939416463c79a45d91729e8a00742fa
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:40 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:36 2013 +0100

    tools/xenstat/libxenstat: Remove src/libxenstat.a file during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstat/libxenstat/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index adeb495..21aad89 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -139,7 +139,7 @@ endif
 
 .PHONY: clean
 clean:
-	rm -f $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
+	rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
 	      $(BINDINGS) $(BINDINGSRC) $(DEPS)
 
 -include $(DEPS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEf-0007MO-UJ; Thu, 09 May 2013 01:01:29 +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 1UaFEe-000768-FO
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:28 +0000
Received: from [85.158.139.83:62832] by server-7.bemta-5.messagelabs.com id
	C9/C1-12828-765FA815; Thu, 09 May 2013 01:01:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1368061285!32000339!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16831 invoked from network); 9 May 2013 01:01:26 -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;
	9 May 2013 01:01:26 -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 1UaFEb-0005XO-Os
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEb-0001Jj-Ks
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:25 +0000
Date: Thu, 09 May 2013 01:01:25 +0000
Message-Id: <E1UaFEb-0001Jj-Ks@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstat/libxenstat: Remove
	src/libxenstat.a file during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 03b90b005939416463c79a45d91729e8a00742fa
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:40 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:36 2013 +0100

    tools/xenstat/libxenstat: Remove src/libxenstat.a file during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstat/libxenstat/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index adeb495..21aad89 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -139,7 +139,7 @@ endif
 
 .PHONY: clean
 clean:
-	rm -f $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
+	rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
 	      $(BINDINGS) $(BINDINGSRC) $(DEPS)
 
 -include $(DEPS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEq-0000VH-18; Thu, 09 May 2013 01:01:40 +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 1UaFEo-0000A5-Gn
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:38 +0000
Received: from [85.158.139.83:43646] by server-4.bemta-5.messagelabs.com id
	DA/5E-12332-175FA815; Thu, 09 May 2013 01:01:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1368061296!30817693!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20751 invoked from network); 9 May 2013 01:01:37 -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;
	9 May 2013 01:01:37 -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 1UaFEm-0007CW-0m
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEl-0001KB-UP
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:35 +0000
Date: Thu, 09 May 2013 01:01:35 +0000
Message-Id: <E1UaFEl-0001KB-UP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Clean extras/mini-os
	directory during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2bf87074e17e77ca761e3490e5f054175e082e5b
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:41 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:39 2013 +0100

    stubdom: Clean extras/mini-os directory during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index a2ac044..91e2e1a 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -498,6 +498,7 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
+	$(MAKE) DESTDIR= -C $(MINI_OS) clean
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
 	$(MAKE) -C vtpm clean
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:01: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 1UaFEq-0000VH-18; Thu, 09 May 2013 01:01:40 +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 1UaFEo-0000A5-Gn
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:38 +0000
Received: from [85.158.139.83:43646] by server-4.bemta-5.messagelabs.com id
	DA/5E-12332-175FA815; Thu, 09 May 2013 01:01:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1368061296!30817693!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20751 invoked from network); 9 May 2013 01:01:37 -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;
	9 May 2013 01:01:37 -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 1UaFEm-0007CW-0m
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEl-0001KB-UP
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:35 +0000
Date: Thu, 09 May 2013 01:01:35 +0000
Message-Id: <E1UaFEl-0001KB-UP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Clean extras/mini-os
	directory during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2bf87074e17e77ca761e3490e5f054175e082e5b
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:41 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:39 2013 +0100

    stubdom: Clean extras/mini-os directory during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index a2ac044..91e2e1a 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -498,6 +498,7 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
+	$(MAKE) DESTDIR= -C $(MINI_OS) clean
 	$(MAKE) DESTDIR= -C caml clean
 	$(MAKE) DESTDIR= -C c clean
 	$(MAKE) -C vtpm clean
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01: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 1UaFF6-0002mc-53; Thu, 09 May 2013 01:01:56 +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 1UaFF4-0002Wf-Tz
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:55 +0000
Received: from [193.109.254.147:59603] by server-9.bemta-14.messagelabs.com id
	18/5B-15694-285FA815; Thu, 09 May 2013 01:01:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368061306!8496271!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 606 invoked from network); 9 May 2013 01:01:48 -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;
	9 May 2013 01:01: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 1UaFEw-0000JZ-JG
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEw-0001Kf-9z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:46 +0000
Date: Thu, 09 May 2013 01:01:46 +0000
Message-Id: <E1UaFEw-0001Kf-9z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Remove xenstore directory
	during make crossclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 43be6972f977660ba9aaf15f78e39c025c9550d8
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:42 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:43 2013 +0100

    stubdom: Remove xenstore directory during make crossclean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 91e2e1a..b1a2d18 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -515,7 +515,7 @@ crossclean: clean
 	rm -fr $(CROSS_ROOT)
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
-	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu xenstore
 	rm -fr gmp-$(XEN_TARGET_ARCH)
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr openssl-$(XEN_TARGET_ARCH)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:01:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01: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 1UaFF6-0002mc-53; Thu, 09 May 2013 01:01:56 +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 1UaFF4-0002Wf-Tz
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:55 +0000
Received: from [193.109.254.147:59603] by server-9.bemta-14.messagelabs.com id
	18/5B-15694-285FA815; Thu, 09 May 2013 01:01:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368061306!8496271!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 606 invoked from network); 9 May 2013 01:01:48 -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;
	9 May 2013 01:01: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 1UaFEw-0000JZ-JG
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFEw-0001Kf-9z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:46 +0000
Date: Thu, 09 May 2013 01:01:46 +0000
Message-Id: <E1UaFEw-0001Kf-9z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Remove xenstore directory
	during make crossclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 43be6972f977660ba9aaf15f78e39c025c9550d8
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:42 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:43 2013 +0100

    stubdom: Remove xenstore directory during make crossclean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 91e2e1a..b1a2d18 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -515,7 +515,7 @@ crossclean: clean
 	rm -fr $(CROSS_ROOT)
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
-	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu xenstore
 	rm -fr gmp-$(XEN_TARGET_ARCH)
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr openssl-$(XEN_TARGET_ARCH)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UaFFD-0003uI-7s; Thu, 09 May 2013 01:02:03 +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 1UaFFC-0003j4-Le
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:02 +0000
Received: from [85.158.138.51:40989] by server-4.bemta-3.messagelabs.com id
	58/0C-01776-685FA815; Thu, 09 May 2013 01:01:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1368061317!28479633!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9310 invoked from network); 9 May 2013 01:01:58 -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;
	9 May 2013 01:01: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 1UaFF6-0001lg-VJ
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFF6-0001LX-PN
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:56 +0000
Date: Thu, 09 May 2013 01:01:56 +0000
Message-Id: <E1UaFF6-0001LX-PN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Do not create dangling links
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c2eea87c43d1617b2c15c57fce9a64a436679fca
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:43 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:46 2013 +0100

    stubdom: Do not create dangling links
    
    There is not architecture dependent files in libxc
    hence do not create dangling links.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index b1a2d18..f316d4e 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -304,11 +304,6 @@ mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/Makefile . )
-	mkdir -p libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH)
-	[ -h libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ] || ( cd libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) && \
-	  ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \
-	  ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \
-	  ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . )
 	mkdir -p xenstore
 	[ -h xenstore/Makefile ] || ( cd xenstore && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.c . && \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UaFFD-0003uI-7s; Thu, 09 May 2013 01:02:03 +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 1UaFFC-0003j4-Le
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:02 +0000
Received: from [85.158.138.51:40989] by server-4.bemta-3.messagelabs.com id
	58/0C-01776-685FA815; Thu, 09 May 2013 01:01:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1368061317!28479633!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9310 invoked from network); 9 May 2013 01:01:58 -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;
	9 May 2013 01:01: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 1UaFF6-0001lg-VJ
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFF6-0001LX-PN
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:01:56 +0000
Date: Thu, 09 May 2013 01:01:56 +0000
Message-Id: <E1UaFF6-0001LX-PN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Do not create dangling links
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c2eea87c43d1617b2c15c57fce9a64a436679fca
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:43 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:46 2013 +0100

    stubdom: Do not create dangling links
    
    There is not architecture dependent files in libxc
    hence do not create dangling links.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index b1a2d18..f316d4e 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -304,11 +304,6 @@ mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/Makefile . )
-	mkdir -p libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH)
-	[ -h libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ] || ( cd libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) && \
-	  ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \
-	  ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \
-	  ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . )
 	mkdir -p xenstore
 	[ -h xenstore/Makefile ] || ( cd xenstore && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.c . && \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFK-0004yU-BC; Thu, 09 May 2013 01:02: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 1UaFFJ-0004qL-Mm
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:09 +0000
Received: from [85.158.139.211:53275] by server-16.bemta-5.messagelabs.com id
	55/F0-31493-095FA815; Thu, 09 May 2013 01:02:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1368061327!22304535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1390 invoked from network); 9 May 2013 01:02:08 -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;
	9 May 2013 01:02: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 1UaFFH-0003J6-8N
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFH-0001Ly-6P
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:07 +0000
Date: Thu, 09 May 2013 01:02:07 +0000
Message-Id: <E1UaFFH-0001Ly-6P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: Silently ignore rm
	errors during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3eb7adb2bad48de7bba4e213c9858de0cbba2fe8
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:44 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:53 2013 +0100

    stubdom/vtpm: Silently ignore rm errors during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
index 37051c1..316794c 100644
--- a/stubdom/vtpm/Makefile
+++ b/stubdom/vtpm/Makefile
@@ -29,6 +29,6 @@ vtpm_manager.h:
 	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
 
 clean:
-	-rm $(TARGET) $(OBJS) vtpm_manager.h
+	rm -f $(TARGET) $(OBJS) vtpm_manager.h
 
 .PHONY: clean
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFK-0004yU-BC; Thu, 09 May 2013 01:02: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 1UaFFJ-0004qL-Mm
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:09 +0000
Received: from [85.158.139.211:53275] by server-16.bemta-5.messagelabs.com id
	55/F0-31493-095FA815; Thu, 09 May 2013 01:02:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1368061327!22304535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1390 invoked from network); 9 May 2013 01:02:08 -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;
	9 May 2013 01:02: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 1UaFFH-0003J6-8N
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFH-0001Ly-6P
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:07 +0000
Date: Thu, 09 May 2013 01:02:07 +0000
Message-Id: <E1UaFFH-0001Ly-6P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: Silently ignore rm
	errors during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3eb7adb2bad48de7bba4e213c9858de0cbba2fe8
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:44 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:14:53 2013 +0100

    stubdom/vtpm: Silently ignore rm errors during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stubdom/vtpm/Makefile b/stubdom/vtpm/Makefile
index 37051c1..316794c 100644
--- a/stubdom/vtpm/Makefile
+++ b/stubdom/vtpm/Makefile
@@ -29,6 +29,6 @@ vtpm_manager.h:
 	ln -s ../vtpmmgr/vtpm_manager.h vtpm_manager.h
 
 clean:
-	-rm $(TARGET) $(OBJS) vtpm_manager.h
+	rm -f $(TARGET) $(OBJS) vtpm_manager.h
 
 .PHONY: clean
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFV-0006g8-EY; Thu, 09 May 2013 01:02: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 1UaFFU-0006SC-4D
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:20 +0000
Received: from [85.158.139.211:53559] by server-1.bemta-5.messagelabs.com id
	5D/A0-01720-B95FA815; Thu, 09 May 2013 01:02:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1368061337!22208521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25291 invoked from network); 9 May 2013 01:02:18 -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;
	9 May 2013 01:02: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 1UaFFR-0004Xb-Hu
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFR-0001MM-E5
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:17 +0000
Date: Thu, 09 May 2013 01:02:17 +0000
Message-Id: <E1UaFFR-0001MM-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Remove tmp files during make
	clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 e17295d050110bdbbe0ef19c6e977c8fef7557db
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:45 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:17 2013 +0100

    docs: Remove tmp files during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index 5f319a1..72b3c0b 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -68,7 +68,7 @@ man5/%.5: man/%.pod.5 Makefile
 clean:
 	$(MAKE) -C figs clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
-	rm -rf *.ilg *.log *.ind *.toc *.bak core
+	rm -rf *.ilg *.log *.ind *.toc *.bak *.tmp core
 	rm -rf html txt
 	rm -rf man5
 	rm -rf man1
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFV-0006g8-EY; Thu, 09 May 2013 01:02: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 1UaFFU-0006SC-4D
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:20 +0000
Received: from [85.158.139.211:53559] by server-1.bemta-5.messagelabs.com id
	5D/A0-01720-B95FA815; Thu, 09 May 2013 01:02:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1368061337!22208521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25291 invoked from network); 9 May 2013 01:02:18 -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;
	9 May 2013 01:02: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 1UaFFR-0004Xb-Hu
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFR-0001MM-E5
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:17 +0000
Date: Thu, 09 May 2013 01:02:17 +0000
Message-Id: <E1UaFFR-0001MM-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Remove tmp files during make
	clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 e17295d050110bdbbe0ef19c6e977c8fef7557db
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:45 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:17 2013 +0100

    docs: Remove tmp files during make clean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index 5f319a1..72b3c0b 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -68,7 +68,7 @@ man5/%.5: man/%.pod.5 Makefile
 clean:
 	$(MAKE) -C figs clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
-	rm -rf *.ilg *.log *.ind *.toc *.bak core
+	rm -rf *.ilg *.log *.ind *.toc *.bak *.tmp core
 	rm -rf html txt
 	rm -rf man5
 	rm -rf man1
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFf-0007G9-ID; Thu, 09 May 2013 01:02:31 +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 1UaFFe-0007Fo-0s
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:30 +0000
Received: from [85.158.143.99:61626] by server-2.bemta-4.messagelabs.com id
	62/46-27124-5A5FA815; Thu, 09 May 2013 01:02:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1368061348!23065607!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7096 invoked from network); 9 May 2013 01:02:28 -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;
	9 May 2013 01:02: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 1UaFFb-0006JQ-RC
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFb-0001Mi-Pl
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:27 +0000
Date: Thu, 09 May 2013 01:02:27 +0000
Message-Id: <E1UaFFb-0001Mi-Pl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Silently ignore rm and include errors
	during make distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 38aabce5424710badc080decca23628442d80673
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:46 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:20 2013 +0100

    Silently ignore rm and include errors during make distclean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Makefile                         |    2 +-
 buildconfigs/mk.linux-2.6-common |    2 +-
 stubdom/Makefile                 |    3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 32efb70..5a7107e 100644
--- a/Makefile
+++ b/Makefile
@@ -158,7 +158,7 @@ endif
 # clean, but blow away kernel build tree plus tarballs
 .PHONY: distclean
 distclean:
-	-rm config/Toplevel.mk
+	rm -f config/Toplevel.mk
 	$(MAKE) -C xen distclean
 	$(MAKE) -C tools distclean
 	$(MAKE) -C stubdom distclean
diff --git a/buildconfigs/mk.linux-2.6-common b/buildconfigs/mk.linux-2.6-common
index f3680f0..e8e97fb 100644
--- a/buildconfigs/mk.linux-2.6-common
+++ b/buildconfigs/mk.linux-2.6-common
@@ -29,7 +29,7 @@ LINUX_VER3  := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
 .PHONY: _build
 _build: build
 
-include buildconfigs/src.$(XEN_LINUX_SOURCE)
+-include buildconfigs/src.$(XEN_LINUX_SOURCE)
 
 LINUX_ARCH = $$(sh buildconfigs/select-linux-arch $(LINUX_SRCDIR))
 IMAGE_PATH = $$(sh buildconfigs/select-linux-image $(LINUX_DIR) $(LINUX_ARCH) $(IMAGE_TARGET))
diff --git a/stubdom/Makefile b/stubdom/Makefile
index f316d4e..32f0daf 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -546,8 +546,7 @@ downloadclean: patchclean
 
 .PHONY: distclean
 distclean: downloadclean
-	-rm ../config/Stubdom.mk
-	rm -rf config.log config.status config.cache autom4te.cache
+	rm -rf config.log config.status config.cache autom4te.cache ../config/Stubdom.mk
 
 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Stubdom.mk:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFf-0007G9-ID; Thu, 09 May 2013 01:02:31 +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 1UaFFe-0007Fo-0s
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:30 +0000
Received: from [85.158.143.99:61626] by server-2.bemta-4.messagelabs.com id
	62/46-27124-5A5FA815; Thu, 09 May 2013 01:02:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1368061348!23065607!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7096 invoked from network); 9 May 2013 01:02:28 -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;
	9 May 2013 01:02: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 1UaFFb-0006JQ-RC
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFb-0001Mi-Pl
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:27 +0000
Date: Thu, 09 May 2013 01:02:27 +0000
Message-Id: <E1UaFFb-0001Mi-Pl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Silently ignore rm and include errors
	during make distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 38aabce5424710badc080decca23628442d80673
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:46 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:20 2013 +0100

    Silently ignore rm and include errors during make distclean
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Makefile                         |    2 +-
 buildconfigs/mk.linux-2.6-common |    2 +-
 stubdom/Makefile                 |    3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 32efb70..5a7107e 100644
--- a/Makefile
+++ b/Makefile
@@ -158,7 +158,7 @@ endif
 # clean, but blow away kernel build tree plus tarballs
 .PHONY: distclean
 distclean:
-	-rm config/Toplevel.mk
+	rm -f config/Toplevel.mk
 	$(MAKE) -C xen distclean
 	$(MAKE) -C tools distclean
 	$(MAKE) -C stubdom distclean
diff --git a/buildconfigs/mk.linux-2.6-common b/buildconfigs/mk.linux-2.6-common
index f3680f0..e8e97fb 100644
--- a/buildconfigs/mk.linux-2.6-common
+++ b/buildconfigs/mk.linux-2.6-common
@@ -29,7 +29,7 @@ LINUX_VER3  := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
 .PHONY: _build
 _build: build
 
-include buildconfigs/src.$(XEN_LINUX_SOURCE)
+-include buildconfigs/src.$(XEN_LINUX_SOURCE)
 
 LINUX_ARCH = $$(sh buildconfigs/select-linux-arch $(LINUX_SRCDIR))
 IMAGE_PATH = $$(sh buildconfigs/select-linux-image $(LINUX_DIR) $(LINUX_ARCH) $(IMAGE_TARGET))
diff --git a/stubdom/Makefile b/stubdom/Makefile
index f316d4e..32f0daf 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -546,8 +546,7 @@ downloadclean: patchclean
 
 .PHONY: distclean
 distclean: downloadclean
-	-rm ../config/Stubdom.mk
-	rm -rf config.log config.status config.cache autom4te.cache
+	rm -rf config.log config.status config.cache autom4te.cache ../config/Stubdom.mk
 
 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Stubdom.mk:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFp-0007IG-LD; Thu, 09 May 2013 01:02: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 1UaFFo-0007Hp-Ev
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:40 +0000
Received: from [85.158.139.83:3992] by server-11.bemta-5.messagelabs.com id
	00/29-26693-FA5FA815; Thu, 09 May 2013 01:02:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1368061358!24559944!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27996 invoked from network); 9 May 2013 01:02:39 -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;
	9 May 2013 01:02: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 1UaFFm-0007x2-2a
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFm-0001N8-1D
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:38 +0000
Date: Thu, 09 May 2013 01:02:38 +0000
Message-Id: <E1UaFFm-0001N8-1D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove tools/libaio/src/syscall-ia64.h
	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

commit 233693387317c5e046942f59b507474f101dc5ab
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:47 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:23 2013 +0100

    Remove tools/libaio/src/syscall-ia64.h file
    
    There is no support for IA-64 architecture in Xen.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libaio/src/syscall-ia64.h |   45 ---------------------------------------
 1 files changed, 0 insertions(+), 45 deletions(-)

diff --git a/tools/libaio/src/syscall-ia64.h b/tools/libaio/src/syscall-ia64.h
deleted file mode 100644
index 52ce9dd..0000000
--- a/tools/libaio/src/syscall-ia64.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#define __NR_io_setup		1238
-#define __NR_io_destroy		1239
-#define __NR_io_getevents	1240
-#define __NR_io_submit		1241
-#define __NR_io_cancel		1242
-
-#define __ia64_raw_syscall(fname, sname) \
-	__asm__ (".text\n"						\
-		".globl " SYMSTR(fname) "\n"				\
-		".proc " SYMSTR(fname) "\n"				\
-		SYMSTR(fname) ":\n"					\
-		"	mov r15=" SYMSTR( __NR_ ## sname ) "\n"		\
-		"	break 0x100000\n"				\
-		"	;;\n"						\
-		"	cmp.eq p6,p0=-1,r10\n"				\
-		"	;;\n"						\
-		"	(p6) sub r8=0,r8\n"				\
-		"	br.ret.sptk.few b0\n"				\
-		".size " SYMSTR(fname) ", . - " SYMSTR(fname) "\n"	\
-		".endp " SYMSTR(fname) "\n"				\
-	);
-
-#define io_syscall0(type, name)						\
-	extern type name(void);						\
-	__ia64_raw_syscall(name);
-
-#define io_syscall1(type, fname, sname, type1, arg1)			\
-	extern type fname(type1 arg1);					\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall2(type, fname, sname, type1, arg1, type2, arg2)	\
-	extern type fname(type1 arg1, type2 arg2);			\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall3(type, fname, sname, type1, arg1, type2, arg2, type3, arg3)	\
-	extern type fname(type1 arg1, type2 arg2, type3 arg3);		\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall4(type, fname, sname, type1, arg1, type2, arg2, type3, arg3, type4, arg4)	\
-	extern type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4);		\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall5(type, fname, sname, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5)	\
-	extern type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5);			\
-	__ia64_raw_syscall(fname, sname);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:02: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 1UaFFp-0007IG-LD; Thu, 09 May 2013 01:02: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 1UaFFo-0007Hp-Ev
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:40 +0000
Received: from [85.158.139.83:3992] by server-11.bemta-5.messagelabs.com id
	00/29-26693-FA5FA815; Thu, 09 May 2013 01:02:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1368061358!24559944!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27996 invoked from network); 9 May 2013 01:02:39 -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;
	9 May 2013 01:02: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 1UaFFm-0007x2-2a
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFm-0001N8-1D
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:38 +0000
Date: Thu, 09 May 2013 01:02:38 +0000
Message-Id: <E1UaFFm-0001N8-1D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove tools/libaio/src/syscall-ia64.h
	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

commit 233693387317c5e046942f59b507474f101dc5ab
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:47 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:23 2013 +0100

    Remove tools/libaio/src/syscall-ia64.h file
    
    There is no support for IA-64 architecture in Xen.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libaio/src/syscall-ia64.h |   45 ---------------------------------------
 1 files changed, 0 insertions(+), 45 deletions(-)

diff --git a/tools/libaio/src/syscall-ia64.h b/tools/libaio/src/syscall-ia64.h
deleted file mode 100644
index 52ce9dd..0000000
--- a/tools/libaio/src/syscall-ia64.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#define __NR_io_setup		1238
-#define __NR_io_destroy		1239
-#define __NR_io_getevents	1240
-#define __NR_io_submit		1241
-#define __NR_io_cancel		1242
-
-#define __ia64_raw_syscall(fname, sname) \
-	__asm__ (".text\n"						\
-		".globl " SYMSTR(fname) "\n"				\
-		".proc " SYMSTR(fname) "\n"				\
-		SYMSTR(fname) ":\n"					\
-		"	mov r15=" SYMSTR( __NR_ ## sname ) "\n"		\
-		"	break 0x100000\n"				\
-		"	;;\n"						\
-		"	cmp.eq p6,p0=-1,r10\n"				\
-		"	;;\n"						\
-		"	(p6) sub r8=0,r8\n"				\
-		"	br.ret.sptk.few b0\n"				\
-		".size " SYMSTR(fname) ", . - " SYMSTR(fname) "\n"	\
-		".endp " SYMSTR(fname) "\n"				\
-	);
-
-#define io_syscall0(type, name)						\
-	extern type name(void);						\
-	__ia64_raw_syscall(name);
-
-#define io_syscall1(type, fname, sname, type1, arg1)			\
-	extern type fname(type1 arg1);					\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall2(type, fname, sname, type1, arg1, type2, arg2)	\
-	extern type fname(type1 arg1, type2 arg2);			\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall3(type, fname, sname, type1, arg1, type2, arg2, type3, arg3)	\
-	extern type fname(type1 arg1, type2 arg2, type3 arg3);		\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall4(type, fname, sname, type1, arg1, type2, arg2, type3, arg3, type4, arg4)	\
-	extern type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4);		\
-	__ia64_raw_syscall(fname, sname);
-
-#define io_syscall5(type, fname, sname, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5)	\
-	extern type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5);			\
-	__ia64_raw_syscall(fname, sname);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01: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 1UaFG0-0007Km-VQ; Thu, 09 May 2013 01:02:52 +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 1UaFFz-0007KJ-1z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:51 +0000
Received: from [85.158.138.51:56172] by server-1.bemta-3.messagelabs.com id
	9C/23-20211-AB5FA815; Thu, 09 May 2013 01:02:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1368061368!31860235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32189 invoked from network); 9 May 2013 01:02:49 -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;
	9 May 2013 01:02:49 -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 1UaFFw-0000Yh-9i
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFw-0001Nb-8E
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:48 +0000
Date: Thu, 09 May 2013 01:02:48 +0000
Message-Id: <E1UaFFw-0001Nb-8E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove traces of IA-64 architecture
	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 80185fd5ba2aa1d5979b900468937da59d051df7
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:48 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:27 2013 +0100

    Remove traces of IA-64 architecture support
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/Makefile    |    2 +-
 stubdom/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index 72b3c0b..b26738c 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -128,7 +128,7 @@ html/hypercall/index.html: ./xen-headers
 	$(INSTALL_DIR) $(@D)
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
-		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 -X arch-arm \
+		-X arch-x86_32 -X xen-x86_32 -X arch-arm \
 		../xen include/public include/xen/errno.h
 
 -include html/hypercall/.deps
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 32f0daf..9caccc4 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -292,7 +292,7 @@ endif
 mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp
 	mkdir -p include/xen && \
           ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) include/xen && \
-          ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \
+          ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 hvm io xsm) include/xen && \
           ( [ -h include/xen/sys ] || ln -sf $(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \
           ( [ -h include/xen/libelf ] || ln -sf $(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \
 	  mkdir -p include/xen-foreign && \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:02:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01: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 1UaFG0-0007Km-VQ; Thu, 09 May 2013 01:02:52 +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 1UaFFz-0007KJ-1z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:51 +0000
Received: from [85.158.138.51:56172] by server-1.bemta-3.messagelabs.com id
	9C/23-20211-AB5FA815; Thu, 09 May 2013 01:02:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1368061368!31860235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32189 invoked from network); 9 May 2013 01:02:49 -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;
	9 May 2013 01:02:49 -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 1UaFFw-0000Yh-9i
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFFw-0001Nb-8E
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:48 +0000
Date: Thu, 09 May 2013 01:02:48 +0000
Message-Id: <E1UaFFw-0001Nb-8E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove traces of IA-64 architecture
	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 80185fd5ba2aa1d5979b900468937da59d051df7
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue May 7 13:51:48 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:15:27 2013 +0100

    Remove traces of IA-64 architecture support
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/Makefile    |    2 +-
 stubdom/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index 72b3c0b..b26738c 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -128,7 +128,7 @@ html/hypercall/index.html: ./xen-headers
 	$(INSTALL_DIR) $(@D)
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
-		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 -X arch-arm \
+		-X arch-x86_32 -X xen-x86_32 -X arch-arm \
 		../xen include/public include/xen/errno.h
 
 -include html/hypercall/.deps
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 32f0daf..9caccc4 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -292,7 +292,7 @@ endif
 mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp
 	mkdir -p include/xen && \
           ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) include/xen && \
-          ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \
+          ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 hvm io xsm) include/xen && \
           ( [ -h include/xen/sys ] || ln -sf $(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \
           ( [ -h include/xen/libelf ] || ln -sf $(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \
 	  mkdir -p include/xen-foreign && \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGL-0007Oc-2g; Thu, 09 May 2013 01:03: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 1UaFGJ-0007OK-IB
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:11 +0000
Received: from [85.158.137.99:30808] by server-4.bemta-3.messagelabs.com id
	FB/BC-01776-EC5FA815; Thu, 09 May 2013 01:03:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1368061389!15382284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28496 invoked from network); 9 May 2013 01:03:10 -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;
	9 May 2013 01:03: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 1UaFGG-0000ZL-Pt
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGG-0001P3-O4
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:08 +0000
Date: Thu, 09 May 2013 01:03:08 +0000
Message-Id: <E1UaFGG-0001P3-O4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support
	VCPUOP_register_vcpu_info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 66410d1d18bca2feade55cb312ddf3be04407d57
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:23 2013 +0100

    xen/arm: support VCPUOP_register_vcpu_info.
    
    We don't want to support the full vcpu_op hypercall interface, just
    VCPUOP_register_vcpu_info: introduce an internal ARM-only
    do_arm_vcpu_op function to filter out the vcpu_op hypercalls that
    we don't want to support.
    Call do_arm_vcpu_op instead of do_vcpu_op from traps.c.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c           |   13 +++++++++++++
 xen/arch/arm/traps.c            |    6 ++++++
 xen/include/asm-arm/hypercall.h |    2 ++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 141aa0b..df42d82 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -10,6 +10,7 @@
  * GNU General Public License for more details.
  */
 #include <xen/config.h>
+#include <xen/hypercall.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -629,6 +630,18 @@ void arch_dump_domain_info(struct domain *d)
     }
 }
 
+
+long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+{
+    switch ( cmd )
+    {
+        case VCPUOP_register_vcpu_info:
+            return do_vcpu_op(cmd, vcpuid, arg);
+        default:
+            return -EINVAL;
+    }
+}
+
 long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     return -ENOSYS;
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index c743f2c..83a7fbc 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -653,6 +653,11 @@ typedef struct {
         .nr_args = _nr_args,                                         \
     }
 
+#define HYPERCALL_ARM(_name, _nr_args)                        \
+    [ __HYPERVISOR_ ## _name ] =  {                                  \
+        .fn = (arm_hypercall_fn_t) &do_arm_ ## _name,                \
+        .nr_args = _nr_args,                                         \
+    }
 static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(memory_op, 2),
     HYPERCALL(domctl, 1),
@@ -665,6 +670,7 @@ static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(sysctl, 2),
     HYPERCALL(hvm_op, 2),
     HYPERCALL(grant_table_op, 3),
+    HYPERCALL_ARM(vcpu_op, 3),
 };
 
 #define __PSCI_cpu_suspend 0
diff --git a/xen/include/asm-arm/hypercall.h b/xen/include/asm-arm/hypercall.h
index 0833ec4..3327a96 100644
--- a/xen/include/asm-arm/hypercall.h
+++ b/xen/include/asm-arm/hypercall.h
@@ -4,6 +4,8 @@
 #include <public/domctl.h> /* for arch_do_domctl */
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
+long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg);
+
 #endif /* __ASM_ARM_HYPERCALL_H__ */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGL-0007Oc-2g; Thu, 09 May 2013 01:03: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 1UaFGJ-0007OK-IB
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:11 +0000
Received: from [85.158.137.99:30808] by server-4.bemta-3.messagelabs.com id
	FB/BC-01776-EC5FA815; Thu, 09 May 2013 01:03:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1368061389!15382284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28496 invoked from network); 9 May 2013 01:03:10 -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;
	9 May 2013 01:03: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 1UaFGG-0000ZL-Pt
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGG-0001P3-O4
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:08 +0000
Date: Thu, 09 May 2013 01:03:08 +0000
Message-Id: <E1UaFGG-0001P3-O4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support
	VCPUOP_register_vcpu_info.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 66410d1d18bca2feade55cb312ddf3be04407d57
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:23 2013 +0100

    xen/arm: support VCPUOP_register_vcpu_info.
    
    We don't want to support the full vcpu_op hypercall interface, just
    VCPUOP_register_vcpu_info: introduce an internal ARM-only
    do_arm_vcpu_op function to filter out the vcpu_op hypercalls that
    we don't want to support.
    Call do_arm_vcpu_op instead of do_vcpu_op from traps.c.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c           |   13 +++++++++++++
 xen/arch/arm/traps.c            |    6 ++++++
 xen/include/asm-arm/hypercall.h |    2 ++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 141aa0b..df42d82 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -10,6 +10,7 @@
  * GNU General Public License for more details.
  */
 #include <xen/config.h>
+#include <xen/hypercall.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
@@ -629,6 +630,18 @@ void arch_dump_domain_info(struct domain *d)
     }
 }
 
+
+long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+{
+    switch ( cmd )
+    {
+        case VCPUOP_register_vcpu_info:
+            return do_vcpu_op(cmd, vcpuid, arg);
+        default:
+            return -EINVAL;
+    }
+}
+
 long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     return -ENOSYS;
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index c743f2c..83a7fbc 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -653,6 +653,11 @@ typedef struct {
         .nr_args = _nr_args,                                         \
     }
 
+#define HYPERCALL_ARM(_name, _nr_args)                        \
+    [ __HYPERVISOR_ ## _name ] =  {                                  \
+        .fn = (arm_hypercall_fn_t) &do_arm_ ## _name,                \
+        .nr_args = _nr_args,                                         \
+    }
 static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(memory_op, 2),
     HYPERCALL(domctl, 1),
@@ -665,6 +670,7 @@ static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(sysctl, 2),
     HYPERCALL(hvm_op, 2),
     HYPERCALL(grant_table_op, 3),
+    HYPERCALL_ARM(vcpu_op, 3),
 };
 
 #define __PSCI_cpu_suspend 0
diff --git a/xen/include/asm-arm/hypercall.h b/xen/include/asm-arm/hypercall.h
index 0833ec4..3327a96 100644
--- a/xen/include/asm-arm/hypercall.h
+++ b/xen/include/asm-arm/hypercall.h
@@ -4,6 +4,8 @@
 #include <public/domctl.h> /* for arch_do_domctl */
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
 
+long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg);
+
 #endif /* __ASM_ARM_HYPERCALL_H__ */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGM-0007P4-5P; Thu, 09 May 2013 01:03:14 +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 1UaFGK-0007OU-Cc
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:12 +0000
Received: from [193.109.254.147:61215] by server-16.bemta-14.messagelabs.com
	id A2/5E-10369-FC5FA815; Thu, 09 May 2013 01:03:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1368061378!1915929!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27278 invoked from network); 9 May 2013 01:02:59 -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;
	9 May 2013 01:02: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 1UaFG6-0000Yq-Ie
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFG6-0001Og-GK
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:58 +0000
Date: Thu, 09 May 2013 01:02:58 +0000
Message-Id: <E1UaFG6-0001Og-GK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move VCPUOP_register_vcpu_info to
	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

commit 6ff9e4f743bf2ca4e46bee862dad734777b11b55
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:09 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:18 2013 +0100

    xen: move VCPUOP_register_vcpu_info to common code
    
    Move the implementation of VCPUOP_register_vcpu_info from x86 specific
    to commmon code.
    
    Move vcpu_info_mfn from an arch specific vcpu sub-field to the common
    vcpu struct.
    Move the initialization of vcpu_info_mfn to common code.
    
    Move unmap_vcpu_info and the call to unmap_vcpu_info at domain
    destruction time to common code.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c        |  113 ------------------------------------------
 xen/common/domain.c          |  111 +++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/domain.h |    3 -
 xen/include/xen/domain.h     |    3 +
 xen/include/xen/sched.h      |    3 +
 5 files changed, 117 insertions(+), 116 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index db1e65d..0228db2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -385,8 +385,6 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
-    v->arch.vcpu_info_mfn = INVALID_MFN;
-
     if ( is_hvm_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
@@ -960,99 +958,6 @@ int arch_vcpu_reset(struct vcpu *v)
     return 0;
 }
 
-/* 
- * Unmap the vcpu info page if the guest decided to place it somewhere
- * else.  This is only used from arch_domain_destroy, so there's no
- * need to do anything clever.
- */
-static void
-unmap_vcpu_info(struct vcpu *v)
-{
-    unsigned long mfn;
-
-    if ( v->arch.vcpu_info_mfn == INVALID_MFN )
-        return;
-
-    mfn = v->arch.vcpu_info_mfn;
-    unmap_domain_page_global(v->vcpu_info);
-
-    v->vcpu_info = &dummy_vcpu_info;
-    v->arch.vcpu_info_mfn = INVALID_MFN;
-
-    put_page_and_type(mfn_to_page(mfn));
-}
-
-/* 
- * Map a guest page in and point the vcpu_info pointer at it.  This
- * makes sure that the vcpu_info is always pointing at a valid piece
- * of memory, and it sets a pending event to make sure that a pending
- * event doesn't get missed.
- */
-static int
-map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
-{
-    struct domain *d = v->domain;
-    void *mapping;
-    vcpu_info_t *new_info;
-    struct page_info *page;
-    int i;
-
-    if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
-        return -EINVAL;
-
-    if ( v->arch.vcpu_info_mfn != INVALID_MFN )
-        return -EINVAL;
-
-    /* Run this command on yourself or on other offline VCPUS. */
-    if ( (v != current) && !test_bit(_VPF_down, &v->pause_flags) )
-        return -EINVAL;
-
-    page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
-    if ( !page )
-        return -EINVAL;
-
-    if ( !get_page_type(page, PGT_writable_page) )
-    {
-        put_page(page);
-        return -EINVAL;
-    }
-
-    mapping = __map_domain_page_global(page);
-    if ( mapping == NULL )
-    {
-        put_page_and_type(page);
-        return -ENOMEM;
-    }
-
-    new_info = (vcpu_info_t *)(mapping + offset);
-
-    if ( v->vcpu_info == &dummy_vcpu_info )
-    {
-        memset(new_info, 0, sizeof(*new_info));
-        __vcpu_info(v, new_info, evtchn_upcall_mask) = 1;
-    }
-    else
-    {
-        memcpy(new_info, v->vcpu_info, sizeof(*new_info));
-    }
-
-    v->vcpu_info = new_info;
-    v->arch.vcpu_info_mfn = page_to_mfn(page);
-
-    /* Set new vcpu_info pointer /before/ setting pending flags. */
-    wmb();
-
-    /*
-     * Mark everything as being pending just to make sure nothing gets
-     * lost.  The domain will get a spurious event, but it can cope.
-     */
-    vcpu_info(v, evtchn_upcall_pending) = 1;
-    for ( i = 0; i < BITS_PER_EVTCHN_WORD(d); i++ )
-        set_bit(i, &vcpu_info(v, evtchn_pending_sel));
-
-    return 0;
-}
-
 long
 arch_do_vcpu_op(
     int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -1089,22 +994,6 @@ arch_do_vcpu_op(
         break;
     }
 
-    case VCPUOP_register_vcpu_info:
-    {
-        struct domain *d = v->domain;
-        struct vcpu_register_vcpu_info info;
-
-        rc = -EFAULT;
-        if ( copy_from_guest(&info, arg, 1) )
-            break;
-
-        domain_lock(d);
-        rc = map_vcpu_info(v, info.mfn, info.offset);
-        domain_unlock(d);
-
-        break;
-    }
-
     /*
      * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given
      * virtual address even when running in another domain's address space.
@@ -1971,8 +1860,6 @@ int domain_relinquish_resources(struct domain *d)
             ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
-
-            unmap_vcpu_info(v);
         }
 
         if ( !is_hvm_domain(d) )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8adf00a..d0b2f2e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -33,6 +33,7 @@
 #include <xen/xenoprof.h>
 #include <xen/irq.h>
 #include <asm/debugger.h>
+#include <asm/p2m.h>
 #include <asm/processor.h>
 #include <public/sched.h>
 #include <public/sysctl.h>
@@ -142,6 +143,7 @@ struct vcpu *alloc_vcpu(
         v->vcpu_info = ((vcpu_id < XEN_LEGACY_MAX_VCPUS)
                         ? (vcpu_info_t *)&shared_info(d, vcpu_info[vcpu_id])
                         : &dummy_vcpu_info);
+        v->vcpu_info_mfn = INVALID_MFN;
         init_waitqueue_vcpu(v);
     }
 
@@ -513,6 +515,7 @@ int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d)
 int domain_kill(struct domain *d)
 {
     int rc = 0;
+    struct vcpu *v;
 
     if ( d == current->domain )
         return -EINVAL;
@@ -537,6 +540,8 @@ int domain_kill(struct domain *d)
             BUG_ON(rc != -EAGAIN);
             break;
         }
+        for_each_vcpu ( d, v )
+            unmap_vcpu_info(v);
         d->is_dying = DOMDYING_dead;
         /* Mem event cleanup has to go here because the rings 
          * have to be put before we call put_domain. */
@@ -870,6 +875,96 @@ int vcpu_reset(struct vcpu *v)
     return rc;
 }
 
+/*
+ * Map a guest page in and point the vcpu_info pointer at it.  This
+ * makes sure that the vcpu_info is always pointing at a valid piece
+ * of memory, and it sets a pending event to make sure that a pending
+ * event doesn't get missed.
+ */
+int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
+{
+    struct domain *d = v->domain;
+    void *mapping;
+    vcpu_info_t *new_info;
+    struct page_info *page;
+    int i;
+
+    if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
+        return -EINVAL;
+
+    if ( v->vcpu_info_mfn != INVALID_MFN )
+        return -EINVAL;
+
+    /* Run this command on yourself or on other offline VCPUS. */
+    if ( (v != current) && !test_bit(_VPF_down, &v->pause_flags) )
+        return -EINVAL;
+
+    page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
+    if ( !page )
+        return -EINVAL;
+
+    if ( !get_page_type(page, PGT_writable_page) )
+    {
+        put_page(page);
+        return -EINVAL;
+    }
+
+    mapping = __map_domain_page_global(page);
+    if ( mapping == NULL )
+    {
+        put_page_and_type(page);
+        return -ENOMEM;
+    }
+
+    new_info = (vcpu_info_t *)(mapping + offset);
+
+    if ( v->vcpu_info == &dummy_vcpu_info )
+    {
+        memset(new_info, 0, sizeof(*new_info));
+        __vcpu_info(v, new_info, evtchn_upcall_mask) = 1;
+    }
+    else
+    {
+        memcpy(new_info, v->vcpu_info, sizeof(*new_info));
+    }
+
+    v->vcpu_info = new_info;
+    v->vcpu_info_mfn = page_to_mfn(page);
+
+    /* Set new vcpu_info pointer /before/ setting pending flags. */
+    wmb();
+
+    /*
+     * Mark everything as being pending just to make sure nothing gets
+     * lost.  The domain will get a spurious event, but it can cope.
+     */
+    vcpu_info(v, evtchn_upcall_pending) = 1;
+    for ( i = 0; i < BITS_PER_EVTCHN_WORD(d); i++ )
+        set_bit(i, &vcpu_info(v, evtchn_pending_sel));
+
+    return 0;
+}
+
+/*
+ * Unmap the vcpu info page if the guest decided to place it somewhere
+ * else.  This is only used from arch_domain_destroy, so there's no
+ * need to do anything clever.
+ */
+void unmap_vcpu_info(struct vcpu *v)
+{
+    unsigned long mfn;
+
+    if ( v->vcpu_info_mfn == INVALID_MFN )
+        return;
+
+    mfn = v->vcpu_info_mfn;
+    unmap_domain_page_global(v->vcpu_info);
+
+    v->vcpu_info = &dummy_vcpu_info;
+    v->vcpu_info_mfn = INVALID_MFN;
+
+    put_page_and_type(mfn_to_page(mfn));
+}
 
 long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
@@ -994,6 +1089,22 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         break;
 
+    case VCPUOP_register_vcpu_info:
+    {
+        struct domain *d = v->domain;
+        struct vcpu_register_vcpu_info info;
+
+        rc = -EFAULT;
+        if ( copy_from_guest(&info, arg, 1) )
+            break;
+
+        domain_lock(d);
+        rc = map_vcpu_info(v, info.mfn, info.offset);
+        domain_unlock(d);
+
+        break;
+    }
+
 #ifdef VCPU_TRAP_NMI
     case VCPUOP_send_nmi:
         if ( !guest_handle_is_null(arg) )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 83fbe58..d79464d 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -436,9 +436,6 @@ struct arch_vcpu
 
     struct paging_vcpu paging;
 
-    /* Guest-specified relocation of vcpu_info. */
-    unsigned long vcpu_info_mfn;
-
     uint32_t gdbsx_vcpu_event;
 
     /* A secondary copy of the vcpu time info. */
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 504a70f..a057069 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -52,6 +52,9 @@ void free_pirq_struct(void *);
 int  vcpu_initialise(struct vcpu *v);
 void vcpu_destroy(struct vcpu *v);
 
+int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset);
+void unmap_vcpu_info(struct vcpu *v);
+
 int arch_domain_create(struct domain *d, unsigned int domcr_flags);
 
 void arch_domain_destroy(struct domain *d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 5b55c09..ae6a3b8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -192,6 +192,9 @@ struct vcpu
 
     struct waitqueue_vcpu *waitqueue_vcpu;
 
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long vcpu_info_mfn;
+
     struct arch_vcpu arch;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGM-0007P4-5P; Thu, 09 May 2013 01:03:14 +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 1UaFGK-0007OU-Cc
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:12 +0000
Received: from [193.109.254.147:61215] by server-16.bemta-14.messagelabs.com
	id A2/5E-10369-FC5FA815; Thu, 09 May 2013 01:03:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1368061378!1915929!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27278 invoked from network); 9 May 2013 01:02:59 -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;
	9 May 2013 01:02: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 1UaFG6-0000Yq-Ie
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFG6-0001Og-GK
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:02:58 +0000
Date: Thu, 09 May 2013 01:02:58 +0000
Message-Id: <E1UaFG6-0001Og-GK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move VCPUOP_register_vcpu_info to
	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

commit 6ff9e4f743bf2ca4e46bee862dad734777b11b55
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:09 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:18 2013 +0100

    xen: move VCPUOP_register_vcpu_info to common code
    
    Move the implementation of VCPUOP_register_vcpu_info from x86 specific
    to commmon code.
    
    Move vcpu_info_mfn from an arch specific vcpu sub-field to the common
    vcpu struct.
    Move the initialization of vcpu_info_mfn to common code.
    
    Move unmap_vcpu_info and the call to unmap_vcpu_info at domain
    destruction time to common code.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c        |  113 ------------------------------------------
 xen/common/domain.c          |  111 +++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/domain.h |    3 -
 xen/include/xen/domain.h     |    3 +
 xen/include/xen/sched.h      |    3 +
 5 files changed, 117 insertions(+), 116 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index db1e65d..0228db2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -385,8 +385,6 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
-    v->arch.vcpu_info_mfn = INVALID_MFN;
-
     if ( is_hvm_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
@@ -960,99 +958,6 @@ int arch_vcpu_reset(struct vcpu *v)
     return 0;
 }
 
-/* 
- * Unmap the vcpu info page if the guest decided to place it somewhere
- * else.  This is only used from arch_domain_destroy, so there's no
- * need to do anything clever.
- */
-static void
-unmap_vcpu_info(struct vcpu *v)
-{
-    unsigned long mfn;
-
-    if ( v->arch.vcpu_info_mfn == INVALID_MFN )
-        return;
-
-    mfn = v->arch.vcpu_info_mfn;
-    unmap_domain_page_global(v->vcpu_info);
-
-    v->vcpu_info = &dummy_vcpu_info;
-    v->arch.vcpu_info_mfn = INVALID_MFN;
-
-    put_page_and_type(mfn_to_page(mfn));
-}
-
-/* 
- * Map a guest page in and point the vcpu_info pointer at it.  This
- * makes sure that the vcpu_info is always pointing at a valid piece
- * of memory, and it sets a pending event to make sure that a pending
- * event doesn't get missed.
- */
-static int
-map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
-{
-    struct domain *d = v->domain;
-    void *mapping;
-    vcpu_info_t *new_info;
-    struct page_info *page;
-    int i;
-
-    if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
-        return -EINVAL;
-
-    if ( v->arch.vcpu_info_mfn != INVALID_MFN )
-        return -EINVAL;
-
-    /* Run this command on yourself or on other offline VCPUS. */
-    if ( (v != current) && !test_bit(_VPF_down, &v->pause_flags) )
-        return -EINVAL;
-
-    page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
-    if ( !page )
-        return -EINVAL;
-
-    if ( !get_page_type(page, PGT_writable_page) )
-    {
-        put_page(page);
-        return -EINVAL;
-    }
-
-    mapping = __map_domain_page_global(page);
-    if ( mapping == NULL )
-    {
-        put_page_and_type(page);
-        return -ENOMEM;
-    }
-
-    new_info = (vcpu_info_t *)(mapping + offset);
-
-    if ( v->vcpu_info == &dummy_vcpu_info )
-    {
-        memset(new_info, 0, sizeof(*new_info));
-        __vcpu_info(v, new_info, evtchn_upcall_mask) = 1;
-    }
-    else
-    {
-        memcpy(new_info, v->vcpu_info, sizeof(*new_info));
-    }
-
-    v->vcpu_info = new_info;
-    v->arch.vcpu_info_mfn = page_to_mfn(page);
-
-    /* Set new vcpu_info pointer /before/ setting pending flags. */
-    wmb();
-
-    /*
-     * Mark everything as being pending just to make sure nothing gets
-     * lost.  The domain will get a spurious event, but it can cope.
-     */
-    vcpu_info(v, evtchn_upcall_pending) = 1;
-    for ( i = 0; i < BITS_PER_EVTCHN_WORD(d); i++ )
-        set_bit(i, &vcpu_info(v, evtchn_pending_sel));
-
-    return 0;
-}
-
 long
 arch_do_vcpu_op(
     int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -1089,22 +994,6 @@ arch_do_vcpu_op(
         break;
     }
 
-    case VCPUOP_register_vcpu_info:
-    {
-        struct domain *d = v->domain;
-        struct vcpu_register_vcpu_info info;
-
-        rc = -EFAULT;
-        if ( copy_from_guest(&info, arg, 1) )
-            break;
-
-        domain_lock(d);
-        rc = map_vcpu_info(v, info.mfn, info.offset);
-        domain_unlock(d);
-
-        break;
-    }
-
     /*
      * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given
      * virtual address even when running in another domain's address space.
@@ -1971,8 +1860,6 @@ int domain_relinquish_resources(struct domain *d)
             ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
-
-            unmap_vcpu_info(v);
         }
 
         if ( !is_hvm_domain(d) )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8adf00a..d0b2f2e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -33,6 +33,7 @@
 #include <xen/xenoprof.h>
 #include <xen/irq.h>
 #include <asm/debugger.h>
+#include <asm/p2m.h>
 #include <asm/processor.h>
 #include <public/sched.h>
 #include <public/sysctl.h>
@@ -142,6 +143,7 @@ struct vcpu *alloc_vcpu(
         v->vcpu_info = ((vcpu_id < XEN_LEGACY_MAX_VCPUS)
                         ? (vcpu_info_t *)&shared_info(d, vcpu_info[vcpu_id])
                         : &dummy_vcpu_info);
+        v->vcpu_info_mfn = INVALID_MFN;
         init_waitqueue_vcpu(v);
     }
 
@@ -513,6 +515,7 @@ int rcu_lock_live_remote_domain_by_id(domid_t dom, struct domain **d)
 int domain_kill(struct domain *d)
 {
     int rc = 0;
+    struct vcpu *v;
 
     if ( d == current->domain )
         return -EINVAL;
@@ -537,6 +540,8 @@ int domain_kill(struct domain *d)
             BUG_ON(rc != -EAGAIN);
             break;
         }
+        for_each_vcpu ( d, v )
+            unmap_vcpu_info(v);
         d->is_dying = DOMDYING_dead;
         /* Mem event cleanup has to go here because the rings 
          * have to be put before we call put_domain. */
@@ -870,6 +875,96 @@ int vcpu_reset(struct vcpu *v)
     return rc;
 }
 
+/*
+ * Map a guest page in and point the vcpu_info pointer at it.  This
+ * makes sure that the vcpu_info is always pointing at a valid piece
+ * of memory, and it sets a pending event to make sure that a pending
+ * event doesn't get missed.
+ */
+int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
+{
+    struct domain *d = v->domain;
+    void *mapping;
+    vcpu_info_t *new_info;
+    struct page_info *page;
+    int i;
+
+    if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
+        return -EINVAL;
+
+    if ( v->vcpu_info_mfn != INVALID_MFN )
+        return -EINVAL;
+
+    /* Run this command on yourself or on other offline VCPUS. */
+    if ( (v != current) && !test_bit(_VPF_down, &v->pause_flags) )
+        return -EINVAL;
+
+    page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
+    if ( !page )
+        return -EINVAL;
+
+    if ( !get_page_type(page, PGT_writable_page) )
+    {
+        put_page(page);
+        return -EINVAL;
+    }
+
+    mapping = __map_domain_page_global(page);
+    if ( mapping == NULL )
+    {
+        put_page_and_type(page);
+        return -ENOMEM;
+    }
+
+    new_info = (vcpu_info_t *)(mapping + offset);
+
+    if ( v->vcpu_info == &dummy_vcpu_info )
+    {
+        memset(new_info, 0, sizeof(*new_info));
+        __vcpu_info(v, new_info, evtchn_upcall_mask) = 1;
+    }
+    else
+    {
+        memcpy(new_info, v->vcpu_info, sizeof(*new_info));
+    }
+
+    v->vcpu_info = new_info;
+    v->vcpu_info_mfn = page_to_mfn(page);
+
+    /* Set new vcpu_info pointer /before/ setting pending flags. */
+    wmb();
+
+    /*
+     * Mark everything as being pending just to make sure nothing gets
+     * lost.  The domain will get a spurious event, but it can cope.
+     */
+    vcpu_info(v, evtchn_upcall_pending) = 1;
+    for ( i = 0; i < BITS_PER_EVTCHN_WORD(d); i++ )
+        set_bit(i, &vcpu_info(v, evtchn_pending_sel));
+
+    return 0;
+}
+
+/*
+ * Unmap the vcpu info page if the guest decided to place it somewhere
+ * else.  This is only used from arch_domain_destroy, so there's no
+ * need to do anything clever.
+ */
+void unmap_vcpu_info(struct vcpu *v)
+{
+    unsigned long mfn;
+
+    if ( v->vcpu_info_mfn == INVALID_MFN )
+        return;
+
+    mfn = v->vcpu_info_mfn;
+    unmap_domain_page_global(v->vcpu_info);
+
+    v->vcpu_info = &dummy_vcpu_info;
+    v->vcpu_info_mfn = INVALID_MFN;
+
+    put_page_and_type(mfn_to_page(mfn));
+}
 
 long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
@@ -994,6 +1089,22 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         break;
 
+    case VCPUOP_register_vcpu_info:
+    {
+        struct domain *d = v->domain;
+        struct vcpu_register_vcpu_info info;
+
+        rc = -EFAULT;
+        if ( copy_from_guest(&info, arg, 1) )
+            break;
+
+        domain_lock(d);
+        rc = map_vcpu_info(v, info.mfn, info.offset);
+        domain_unlock(d);
+
+        break;
+    }
+
 #ifdef VCPU_TRAP_NMI
     case VCPUOP_send_nmi:
         if ( !guest_handle_is_null(arg) )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 83fbe58..d79464d 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -436,9 +436,6 @@ struct arch_vcpu
 
     struct paging_vcpu paging;
 
-    /* Guest-specified relocation of vcpu_info. */
-    unsigned long vcpu_info_mfn;
-
     uint32_t gdbsx_vcpu_event;
 
     /* A secondary copy of the vcpu time info. */
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 504a70f..a057069 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -52,6 +52,9 @@ void free_pirq_struct(void *);
 int  vcpu_initialise(struct vcpu *v);
 void vcpu_destroy(struct vcpu *v);
 
+int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset);
+void unmap_vcpu_info(struct vcpu *v);
+
 int arch_domain_create(struct domain *d, unsigned int domcr_flags);
 
 void arch_domain_destroy(struct domain *d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 5b55c09..ae6a3b8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -192,6 +192,9 @@ struct vcpu
 
     struct waitqueue_vcpu *waitqueue_vcpu;
 
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long vcpu_info_mfn;
+
     struct arch_vcpu arch;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGV-0007Qt-8c; Thu, 09 May 2013 01:03: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 1UaFGT-0007QY-EG
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:21 +0000
Received: from [85.158.139.211:64066] by server-14.bemta-5.messagelabs.com id
	33/EC-25870-8D5FA815; Thu, 09 May 2013 01:03:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1368061399!22387807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3553 invoked from network); 9 May 2013 01:03:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 May 2013 01:03: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 1UaFGR-0000ZX-0E
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGQ-0001PZ-Ty
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:18 +0000
Date: Thu, 09 May 2013 01:03:18 +0000
Message-Id: <E1UaFGQ-0001PZ-Ty@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: send IPIs to inject irqs into
	guest vcpus running on different pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0c899a9f6fa9272c74ccdb659bcbfc0e74dcef45
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:30 2013 +0100

    xen/arm: send IPIs to inject irqs into guest vcpus running on different pcpus
    
    If we need to inject an irq into a VCPU that is running on a different
    processor, we shouldn't just enqueue the irq into the lr_pending and
    inflight lists and wait for something to interrupt the guest execution.
    Send an IPI to the target pcpu so that Xen can inject the new interrupt
    returning to guest.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 5d242c8..0e9cc4a 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -648,6 +648,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     struct vgic_irq_rank *rank = vgic_irq_rank(v, 8, idx);
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
+    bool_t running;
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
@@ -683,7 +684,10 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
     /* we have a new higher priority irq, inject it into the guest */
+    running = v->is_running;
     vcpu_unblock(v);
+    if ( running && v != current )
+        smp_send_event_check_mask(cpumask_of(v->processor));
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGV-0007Qt-8c; Thu, 09 May 2013 01:03: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 1UaFGT-0007QY-EG
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:21 +0000
Received: from [85.158.139.211:64066] by server-14.bemta-5.messagelabs.com id
	33/EC-25870-8D5FA815; Thu, 09 May 2013 01:03:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1368061399!22387807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3553 invoked from network); 9 May 2013 01:03:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 May 2013 01:03: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 1UaFGR-0000ZX-0E
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGQ-0001PZ-Ty
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:18 +0000
Date: Thu, 09 May 2013 01:03:18 +0000
Message-Id: <E1UaFGQ-0001PZ-Ty@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: send IPIs to inject irqs into
	guest vcpus running on different pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0c899a9f6fa9272c74ccdb659bcbfc0e74dcef45
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:30 2013 +0100

    xen/arm: send IPIs to inject irqs into guest vcpus running on different pcpus
    
    If we need to inject an irq into a VCPU that is running on a different
    processor, we shouldn't just enqueue the irq into the lr_pending and
    inflight lists and wait for something to interrupt the guest execution.
    Send an IPI to the target pcpu so that Xen can inject the new interrupt
    returning to guest.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 5d242c8..0e9cc4a 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -648,6 +648,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     struct vgic_irq_rank *rank = vgic_irq_rank(v, 8, idx);
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
+    bool_t running;
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
@@ -683,7 +684,10 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
     /* we have a new higher priority irq, inject it into the guest */
+    running = v->is_running;
     vcpu_unblock(v);
+    if ( running && v != current )
+        smp_send_event_check_mask(cpumask_of(v->processor));
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGf-0007Sj-Bn; Thu, 09 May 2013 01:03:33 +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 1UaFGd-0007SP-Md
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:31 +0000
Received: from [85.158.139.211:64394] by server-9.bemta-5.messagelabs.com id
	38/14-14875-2E5FA815; Thu, 09 May 2013 01:03:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1368061409!22331766!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19951 invoked from network); 9 May 2013 01:03:30 -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;
	9 May 2013 01:03: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 1UaFGb-0000Zf-7W
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGb-0001Pv-5v
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:29 +0000
Date: Thu, 09 May 2013 01:03:29 +0000
Message-Id: <E1UaFGb-0001Pv-5v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: run the vtimer Xen timers on
	the pcpu the vcpu is running on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 43e39ffc70d1adff7ff3f3f5c2abfb281589fe1c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:36 2013 +0100

    xen/arm: run the vtimer Xen timers on the pcpu the vcpu is running on
    
    The Xen physical timer emulator and virtual timer driver use two
    internal Xen timers: initialize them on the pcpu the vcpu is running on,
    rather than the processor that it's creating the vcpu.
    
    On vcpu restore migrate the phys_timer and the virt_timer to the
    pcpu the vcpu is running on.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 1cb365e..393aac3 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -48,7 +48,7 @@ int vcpu_vtimer_init(struct vcpu *v)
 {
     struct vtimer *t = &v->arch.phys_timer;
 
-    init_timer(&t->timer, phys_timer_expired, t, smp_processor_id());
+    init_timer(&t->timer, phys_timer_expired, t, v->processor);
     t->ctl = 0;
     t->offset = NOW();
     t->cval = NOW();
@@ -56,7 +56,7 @@ int vcpu_vtimer_init(struct vcpu *v)
     t->v = v;
 
     t = &v->arch.virt_timer;
-    init_timer(&t->timer, virt_timer_expired, t, smp_processor_id());
+    init_timer(&t->timer, virt_timer_expired, t, v->processor);
     t->ctl = 0;
     t->offset = READ_SYSREG64(CNTVCT_EL0) + READ_SYSREG64(CNTVOFF_EL2);
     t->cval = 0;
@@ -95,6 +95,8 @@ int virt_timer_restore(struct vcpu *v)
         return 0;
 
     stop_timer(&v->arch.virt_timer.timer);
+    migrate_timer(&v->arch.virt_timer.timer, v->processor);
+    migrate_timer(&v->arch.phys_timer.timer, v->processor);
 
     WRITE_SYSREG64(v->arch.virt_timer.offset, CNTVOFF_EL2);
     WRITE_SYSREG64(v->arch.virt_timer.cval, CNTV_CVAL_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGf-0007Sj-Bn; Thu, 09 May 2013 01:03:33 +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 1UaFGd-0007SP-Md
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:31 +0000
Received: from [85.158.139.211:64394] by server-9.bemta-5.messagelabs.com id
	38/14-14875-2E5FA815; Thu, 09 May 2013 01:03:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1368061409!22331766!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19951 invoked from network); 9 May 2013 01:03:30 -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;
	9 May 2013 01:03: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 1UaFGb-0000Zf-7W
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGb-0001Pv-5v
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:29 +0000
Date: Thu, 09 May 2013 01:03:29 +0000
Message-Id: <E1UaFGb-0001Pv-5v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: run the vtimer Xen timers on
	the pcpu the vcpu is running on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 43e39ffc70d1adff7ff3f3f5c2abfb281589fe1c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:36 2013 +0100

    xen/arm: run the vtimer Xen timers on the pcpu the vcpu is running on
    
    The Xen physical timer emulator and virtual timer driver use two
    internal Xen timers: initialize them on the pcpu the vcpu is running on,
    rather than the processor that it's creating the vcpu.
    
    On vcpu restore migrate the phys_timer and the virt_timer to the
    pcpu the vcpu is running on.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 1cb365e..393aac3 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -48,7 +48,7 @@ int vcpu_vtimer_init(struct vcpu *v)
 {
     struct vtimer *t = &v->arch.phys_timer;
 
-    init_timer(&t->timer, phys_timer_expired, t, smp_processor_id());
+    init_timer(&t->timer, phys_timer_expired, t, v->processor);
     t->ctl = 0;
     t->offset = NOW();
     t->cval = NOW();
@@ -56,7 +56,7 @@ int vcpu_vtimer_init(struct vcpu *v)
     t->v = v;
 
     t = &v->arch.virt_timer;
-    init_timer(&t->timer, virt_timer_expired, t, smp_processor_id());
+    init_timer(&t->timer, virt_timer_expired, t, v->processor);
     t->ctl = 0;
     t->offset = READ_SYSREG64(CNTVCT_EL0) + READ_SYSREG64(CNTVOFF_EL2);
     t->cval = 0;
@@ -95,6 +95,8 @@ int virt_timer_restore(struct vcpu *v)
         return 0;
 
     stop_timer(&v->arch.virt_timer.timer);
+    migrate_timer(&v->arch.virt_timer.timer, v->processor);
+    migrate_timer(&v->arch.phys_timer.timer, v->processor);
 
     WRITE_SYSREG64(v->arch.virt_timer.offset, CNTVOFF_EL2);
     WRITE_SYSREG64(v->arch.virt_timer.cval, CNTV_CVAL_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGp-0007V7-Gp; Thu, 09 May 2013 01:03:43 +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 1UaFGo-0007Up-5j
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:42 +0000
Received: from [85.158.143.99:7771] by server-1.bemta-4.messagelabs.com id
	93/BD-06122-DE5FA815; Thu, 09 May 2013 01:03:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1368061419!21875630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4801 invoked from network); 9 May 2013 01:03:40 -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;
	9 May 2013 01:03: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 1UaFGl-0000Zl-Eo
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGl-0001QL-DA
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:39 +0000
Date: Thu, 09 May 2013 01:03:39 +0000
Message-Id: <E1UaFGl-0001QL-DA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: initialize virt_timer and
	phys_timer with the same values on all vcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 afb2edfc329395daeb3d90af567f07ddae4ba203
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:13 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:41 2013 +0100

    xen/arm: initialize virt_timer and phys_timer with the same values on all vcpus
    
    Introduce a domain wide vtimer initialization function to initialize
    the phys_timer and the virt_timer offsets.
    
    Use the domain phys_timer and virt_timer offsets throughout the vtimer
    code instead of the per-vcpu offsets.
    
    Remove the per-vcpu offsets from struct vtimer altogether.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |    3 +++
 xen/arch/arm/vtimer.c        |   24 ++++++++++++++++--------
 xen/arch/arm/vtimer.h        |    1 +
 xen/include/asm-arm/domain.h |   24 +++++++++++++++---------
 4 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index df42d82..b22d902 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -485,6 +485,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     if ( (rc = domain_vgic_init(d)) != 0 )
         goto fail;
 
+    if ( (rc = vcpu_domain_init(d)) != 0 )
+        goto fail;
+
     /* Domain 0 gets a real UART not an emulated one */
     if ( d->domain_id && (rc = domain_uart0_init(d)) != 0 )
         goto fail;
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 393aac3..97fe8ce 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -44,13 +44,20 @@ static void virt_timer_expired(void *data)
     vgic_vcpu_inject_irq(t->v, 27, 1);
 }
 
+int vcpu_domain_init(struct domain *d)
+{
+    d->arch.phys_timer_base.offset = NOW();
+    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTVCT_EL0) +
+                                     READ_SYSREG64(CNTVOFF_EL2);
+    return 0;
+}
+
 int vcpu_vtimer_init(struct vcpu *v)
 {
     struct vtimer *t = &v->arch.phys_timer;
 
     init_timer(&t->timer, phys_timer_expired, t, v->processor);
     t->ctl = 0;
-    t->offset = NOW();
     t->cval = NOW();
     t->irq = 30;
     t->v = v;
@@ -58,7 +65,6 @@ int vcpu_vtimer_init(struct vcpu *v)
     t = &v->arch.virt_timer;
     init_timer(&t->timer, virt_timer_expired, t, v->processor);
     t->ctl = 0;
-    t->offset = READ_SYSREG64(CNTVCT_EL0) + READ_SYSREG64(CNTVOFF_EL2);
     t->cval = 0;
     t->irq = 27;
     t->v = v;
@@ -84,7 +90,7 @@ int virt_timer_save(struct vcpu *v)
          !(v->arch.virt_timer.ctl & CNTx_CTL_MASK))
     {
         set_timer(&v->arch.virt_timer.timer, ticks_to_ns(v->arch.virt_timer.cval +
-                  v->arch.virt_timer.offset - boot_count));
+                  v->domain->arch.virt_timer_base.offset - boot_count));
     }
     return 0;
 }
@@ -98,7 +104,7 @@ int virt_timer_restore(struct vcpu *v)
     migrate_timer(&v->arch.virt_timer.timer, v->processor);
     migrate_timer(&v->arch.phys_timer.timer, v->processor);
 
-    WRITE_SYSREG64(v->arch.virt_timer.offset, CNTVOFF_EL2);
+    WRITE_SYSREG64(v->domain->arch.virt_timer_base.offset, CNTVOFF_EL2);
     WRITE_SYSREG64(v->arch.virt_timer.cval, CNTV_CVAL_EL0);
     WRITE_SYSREG32(v->arch.virt_timer.ctl, CNTV_CTL_EL0);
     return 0;
@@ -128,7 +134,8 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
             if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
             {
                 set_timer(&v->arch.phys_timer.timer,
-                          v->arch.phys_timer.cval + v->arch.phys_timer.offset);
+                          v->arch.phys_timer.cval +
+                          v->domain->arch.phys_timer_base.offset);
             }
             else
                 stop_timer(&v->arch.phys_timer.timer);
@@ -137,7 +144,7 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
         return 1;
 
     case HSR_CPREG32(CNTP_TVAL):
-        now = NOW() - v->arch.phys_timer.offset;
+        now = NOW() - v->domain->arch.phys_timer_base.offset;
         if ( cp32.read )
         {
             *r = (uint32_t)(ns_to_ticks(v->arch.phys_timer.cval - now) & 0xffffffffull);
@@ -149,7 +156,8 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
             {
                 v->arch.phys_timer.ctl &= ~CNTx_CTL_PENDING;
                 set_timer(&v->arch.phys_timer.timer,
-                          v->arch.phys_timer.cval + v->arch.phys_timer.offset);
+                          v->arch.phys_timer.cval +
+                          v->domain->arch.phys_timer_base.offset);
             }
         }
 
@@ -174,7 +182,7 @@ static int vtimer_emulate_64(struct cpu_user_regs *regs, union hsr hsr)
     case HSR_CPREG64(CNTPCT):
         if ( cp64.read )
         {
-            now = NOW() - v->arch.phys_timer.offset;
+            now = NOW() - v->domain->arch.phys_timer_base.offset;
             ticks = ns_to_ticks(now);
             *r1 = (uint32_t)(ticks & 0xffffffff);
             *r2 = (uint32_t)(ticks >> 32);
diff --git a/xen/arch/arm/vtimer.h b/xen/arch/arm/vtimer.h
index 690231d..bcf910e 100644
--- a/xen/arch/arm/vtimer.h
+++ b/xen/arch/arm/vtimer.h
@@ -20,6 +20,7 @@
 #ifndef __ARCH_ARM_VTIMER_H__
 #define __ARCH_ARM_VTIMER_H__
 
+extern int vcpu_domain_init(struct domain *d);
 extern int vcpu_vtimer_init(struct vcpu *v);
 extern int vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr);
 extern int virt_timer_save(struct vcpu *v);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 3fa266c2..cca7416 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -47,6 +47,14 @@ enum domain_type {
 #define is_pv64_domain(d) (0)
 #endif
 
+struct vtimer {
+        struct vcpu *v;
+        int irq;
+        struct timer timer;
+        uint32_t ctl;
+        uint64_t cval;
+};
+
 struct arch_domain
 {
 #ifdef CONFIG_ARM_64
@@ -62,6 +70,13 @@ struct arch_domain
     register_t vmpidr;
 
     struct {
+        uint64_t offset;
+    } phys_timer_base;
+    struct {
+        uint64_t offset;
+    } virt_timer_base;
+
+    struct {
         /*
          * Covers access to other members of this struct _except_ for
          * shared_irqs where each member contains its own locking.
@@ -91,15 +106,6 @@ struct arch_domain
 
 }  __cacheline_aligned;
 
-struct vtimer {
-        struct vcpu *v;
-        int irq;
-        struct timer timer;
-        uint32_t ctl;
-        uint64_t offset;
-        uint64_t cval;
-};
-
 struct arch_vcpu
 {
     struct {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGp-0007V7-Gp; Thu, 09 May 2013 01:03:43 +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 1UaFGo-0007Up-5j
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:42 +0000
Received: from [85.158.143.99:7771] by server-1.bemta-4.messagelabs.com id
	93/BD-06122-DE5FA815; Thu, 09 May 2013 01:03:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1368061419!21875630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4801 invoked from network); 9 May 2013 01:03:40 -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;
	9 May 2013 01:03: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 1UaFGl-0000Zl-Eo
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGl-0001QL-DA
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:39 +0000
Date: Thu, 09 May 2013 01:03:39 +0000
Message-Id: <E1UaFGl-0001QL-DA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: initialize virt_timer and
	phys_timer with the same values on all vcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 afb2edfc329395daeb3d90af567f07ddae4ba203
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:13 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:41 2013 +0100

    xen/arm: initialize virt_timer and phys_timer with the same values on all vcpus
    
    Introduce a domain wide vtimer initialization function to initialize
    the phys_timer and the virt_timer offsets.
    
    Use the domain phys_timer and virt_timer offsets throughout the vtimer
    code instead of the per-vcpu offsets.
    
    Remove the per-vcpu offsets from struct vtimer altogether.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |    3 +++
 xen/arch/arm/vtimer.c        |   24 ++++++++++++++++--------
 xen/arch/arm/vtimer.h        |    1 +
 xen/include/asm-arm/domain.h |   24 +++++++++++++++---------
 4 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index df42d82..b22d902 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -485,6 +485,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     if ( (rc = domain_vgic_init(d)) != 0 )
         goto fail;
 
+    if ( (rc = vcpu_domain_init(d)) != 0 )
+        goto fail;
+
     /* Domain 0 gets a real UART not an emulated one */
     if ( d->domain_id && (rc = domain_uart0_init(d)) != 0 )
         goto fail;
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 393aac3..97fe8ce 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -44,13 +44,20 @@ static void virt_timer_expired(void *data)
     vgic_vcpu_inject_irq(t->v, 27, 1);
 }
 
+int vcpu_domain_init(struct domain *d)
+{
+    d->arch.phys_timer_base.offset = NOW();
+    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTVCT_EL0) +
+                                     READ_SYSREG64(CNTVOFF_EL2);
+    return 0;
+}
+
 int vcpu_vtimer_init(struct vcpu *v)
 {
     struct vtimer *t = &v->arch.phys_timer;
 
     init_timer(&t->timer, phys_timer_expired, t, v->processor);
     t->ctl = 0;
-    t->offset = NOW();
     t->cval = NOW();
     t->irq = 30;
     t->v = v;
@@ -58,7 +65,6 @@ int vcpu_vtimer_init(struct vcpu *v)
     t = &v->arch.virt_timer;
     init_timer(&t->timer, virt_timer_expired, t, v->processor);
     t->ctl = 0;
-    t->offset = READ_SYSREG64(CNTVCT_EL0) + READ_SYSREG64(CNTVOFF_EL2);
     t->cval = 0;
     t->irq = 27;
     t->v = v;
@@ -84,7 +90,7 @@ int virt_timer_save(struct vcpu *v)
          !(v->arch.virt_timer.ctl & CNTx_CTL_MASK))
     {
         set_timer(&v->arch.virt_timer.timer, ticks_to_ns(v->arch.virt_timer.cval +
-                  v->arch.virt_timer.offset - boot_count));
+                  v->domain->arch.virt_timer_base.offset - boot_count));
     }
     return 0;
 }
@@ -98,7 +104,7 @@ int virt_timer_restore(struct vcpu *v)
     migrate_timer(&v->arch.virt_timer.timer, v->processor);
     migrate_timer(&v->arch.phys_timer.timer, v->processor);
 
-    WRITE_SYSREG64(v->arch.virt_timer.offset, CNTVOFF_EL2);
+    WRITE_SYSREG64(v->domain->arch.virt_timer_base.offset, CNTVOFF_EL2);
     WRITE_SYSREG64(v->arch.virt_timer.cval, CNTV_CVAL_EL0);
     WRITE_SYSREG32(v->arch.virt_timer.ctl, CNTV_CTL_EL0);
     return 0;
@@ -128,7 +134,8 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
             if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
             {
                 set_timer(&v->arch.phys_timer.timer,
-                          v->arch.phys_timer.cval + v->arch.phys_timer.offset);
+                          v->arch.phys_timer.cval +
+                          v->domain->arch.phys_timer_base.offset);
             }
             else
                 stop_timer(&v->arch.phys_timer.timer);
@@ -137,7 +144,7 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
         return 1;
 
     case HSR_CPREG32(CNTP_TVAL):
-        now = NOW() - v->arch.phys_timer.offset;
+        now = NOW() - v->domain->arch.phys_timer_base.offset;
         if ( cp32.read )
         {
             *r = (uint32_t)(ns_to_ticks(v->arch.phys_timer.cval - now) & 0xffffffffull);
@@ -149,7 +156,8 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
             {
                 v->arch.phys_timer.ctl &= ~CNTx_CTL_PENDING;
                 set_timer(&v->arch.phys_timer.timer,
-                          v->arch.phys_timer.cval + v->arch.phys_timer.offset);
+                          v->arch.phys_timer.cval +
+                          v->domain->arch.phys_timer_base.offset);
             }
         }
 
@@ -174,7 +182,7 @@ static int vtimer_emulate_64(struct cpu_user_regs *regs, union hsr hsr)
     case HSR_CPREG64(CNTPCT):
         if ( cp64.read )
         {
-            now = NOW() - v->arch.phys_timer.offset;
+            now = NOW() - v->domain->arch.phys_timer_base.offset;
             ticks = ns_to_ticks(now);
             *r1 = (uint32_t)(ticks & 0xffffffff);
             *r2 = (uint32_t)(ticks >> 32);
diff --git a/xen/arch/arm/vtimer.h b/xen/arch/arm/vtimer.h
index 690231d..bcf910e 100644
--- a/xen/arch/arm/vtimer.h
+++ b/xen/arch/arm/vtimer.h
@@ -20,6 +20,7 @@
 #ifndef __ARCH_ARM_VTIMER_H__
 #define __ARCH_ARM_VTIMER_H__
 
+extern int vcpu_domain_init(struct domain *d);
 extern int vcpu_vtimer_init(struct vcpu *v);
 extern int vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr);
 extern int virt_timer_save(struct vcpu *v);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 3fa266c2..cca7416 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -47,6 +47,14 @@ enum domain_type {
 #define is_pv64_domain(d) (0)
 #endif
 
+struct vtimer {
+        struct vcpu *v;
+        int irq;
+        struct timer timer;
+        uint32_t ctl;
+        uint64_t cval;
+};
+
 struct arch_domain
 {
 #ifdef CONFIG_ARM_64
@@ -62,6 +70,13 @@ struct arch_domain
     register_t vmpidr;
 
     struct {
+        uint64_t offset;
+    } phys_timer_base;
+    struct {
+        uint64_t offset;
+    } virt_timer_base;
+
+    struct {
         /*
          * Covers access to other members of this struct _except_ for
          * shared_irqs where each member contains its own locking.
@@ -91,15 +106,6 @@ struct arch_domain
 
 }  __cacheline_aligned;
 
-struct vtimer {
-        struct vcpu *v;
-        int irq;
-        struct timer timer;
-        uint32_t ctl;
-        uint64_t offset;
-        uint64_t cval;
-};
-
 struct arch_vcpu
 {
     struct {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGz-0007XD-KG; Thu, 09 May 2013 01:03: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 1UaFGy-0007Wo-78
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:52 +0000
Received: from [85.158.139.83:52562] by server-15.bemta-5.messagelabs.com id
	D6/34-31797-7F5FA815; Thu, 09 May 2013 01:03:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1368061429!24560043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30445 invoked from network); 9 May 2013 01:03:50 -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;
	9 May 2013 01:03: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 1UaFGv-0000Zr-NB
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGv-0001Qh-Lu
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:49 +0000
Date: Thu, 09 May 2013 01:03:49 +0000
Message-Id: <E1UaFGv-0001Qh-Lu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: clear pending irq queues on
	do_psci_cpu_on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 803d6c993abd0319e1cd17ef23301e8cf6ff157b
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:47 2013 +0100

    xen/arm: clear pending irq queues on do_psci_cpu_on
    
    Don't inject irqs to vcpus that are down.
    
    Also when (re)activating a vcpu, clear the vgic and gic irq queues: we
    don't want to inject any irqs that couldn't be handled by the vcpu right
    before going offline.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   12 ++++++++++++
 xen/arch/arm/psci.c       |    3 +++
 xen/arch/arm/vgic.c       |   16 ++++++++++++++--
 xen/include/asm-arm/gic.h |    2 ++
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 2a44cf8..8d35e0e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -576,6 +576,18 @@ static void gic_restore_pending_irqs(struct vcpu *v)
 
 }
 
+void gic_clear_pending_irqs(struct vcpu *v)
+{
+    struct pending_irq *p, *t;
+    unsigned long flags;
+
+    spin_lock_irqsave(&gic.lock, flags);
+    v->arch.lr_mask = 0;
+    list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
+        list_del_init(&p->lr_queue);
+    spin_unlock_irqrestore(&gic.lock, flags);
+}
+
 static void gic_inject_irq_start(void)
 {
     register_t hcr = READ_SYSREG(HCR_EL2);
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 1761791..18feead 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -15,6 +15,7 @@
 #include <xen/types.h>
 
 #include <asm/current.h>
+#include <asm/gic.h>
 #include <asm/psci.h>
 
 int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
@@ -33,6 +34,8 @@ int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
     if ( (ctxt = alloc_vcpu_guest_context()) == NULL )
         return PSCI_DENIED;
 
+    vgic_clear_pending_irqs(v);
+
     memset(ctxt, 0, sizeof(*ctxt));
     ctxt->user_regs.pc64 = (u64) entry_point;
     ctxt->sctlr = SCTLR_BASE;
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 0e9cc4a..f9c1a6b 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -641,6 +641,18 @@ struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq)
     return n;
 }
 
+void vgic_clear_pending_irqs(struct vcpu *v)
+{
+    struct pending_irq *p, *t;
+    unsigned long flags;
+
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+    list_for_each_entry_safe ( p, t, &v->arch.vgic.inflight_irqs, inflight )
+        list_del_init(&p->inflight);
+    gic_clear_pending_irqs(v);
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+}
+
 void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 {
     int idx = irq >> 2, byte = irq & 0x3;
@@ -652,8 +664,8 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
-    /* irq already pending */
-    if (!list_empty(&n->inflight))
+    /* vcpu offline or irq already pending */
+    if (test_bit(_VPF_down, &v->pause_flags) || !list_empty(&n->inflight))
     {
         spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 0f9f74b..84ebc83 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -140,12 +140,14 @@ 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 void vgic_clear_pending_irqs(struct vcpu *v);
 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 gic_clear_pending_irqs(struct vcpu *v);
 extern int gic_events_need_delivery(void);
 
 extern void __cpuinit init_maintenance_interrupt(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:03:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:03: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 1UaFGz-0007XD-KG; Thu, 09 May 2013 01:03: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 1UaFGy-0007Wo-78
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:52 +0000
Received: from [85.158.139.83:52562] by server-15.bemta-5.messagelabs.com id
	D6/34-31797-7F5FA815; Thu, 09 May 2013 01:03:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1368061429!24560043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30445 invoked from network); 9 May 2013 01:03:50 -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;
	9 May 2013 01:03: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 1UaFGv-0000Zr-NB
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFGv-0001Qh-Lu
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:49 +0000
Date: Thu, 09 May 2013 01:03:49 +0000
Message-Id: <E1UaFGv-0001Qh-Lu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: clear pending irq queues on
	do_psci_cpu_on
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 803d6c993abd0319e1cd17ef23301e8cf6ff157b
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:47 2013 +0100

    xen/arm: clear pending irq queues on do_psci_cpu_on
    
    Don't inject irqs to vcpus that are down.
    
    Also when (re)activating a vcpu, clear the vgic and gic irq queues: we
    don't want to inject any irqs that couldn't be handled by the vcpu right
    before going offline.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   12 ++++++++++++
 xen/arch/arm/psci.c       |    3 +++
 xen/arch/arm/vgic.c       |   16 ++++++++++++++--
 xen/include/asm-arm/gic.h |    2 ++
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 2a44cf8..8d35e0e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -576,6 +576,18 @@ static void gic_restore_pending_irqs(struct vcpu *v)
 
 }
 
+void gic_clear_pending_irqs(struct vcpu *v)
+{
+    struct pending_irq *p, *t;
+    unsigned long flags;
+
+    spin_lock_irqsave(&gic.lock, flags);
+    v->arch.lr_mask = 0;
+    list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
+        list_del_init(&p->lr_queue);
+    spin_unlock_irqrestore(&gic.lock, flags);
+}
+
 static void gic_inject_irq_start(void)
 {
     register_t hcr = READ_SYSREG(HCR_EL2);
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 1761791..18feead 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -15,6 +15,7 @@
 #include <xen/types.h>
 
 #include <asm/current.h>
+#include <asm/gic.h>
 #include <asm/psci.h>
 
 int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
@@ -33,6 +34,8 @@ int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point)
     if ( (ctxt = alloc_vcpu_guest_context()) == NULL )
         return PSCI_DENIED;
 
+    vgic_clear_pending_irqs(v);
+
     memset(ctxt, 0, sizeof(*ctxt));
     ctxt->user_regs.pc64 = (u64) entry_point;
     ctxt->sctlr = SCTLR_BASE;
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 0e9cc4a..f9c1a6b 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -641,6 +641,18 @@ struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq)
     return n;
 }
 
+void vgic_clear_pending_irqs(struct vcpu *v)
+{
+    struct pending_irq *p, *t;
+    unsigned long flags;
+
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+    list_for_each_entry_safe ( p, t, &v->arch.vgic.inflight_irqs, inflight )
+        list_del_init(&p->inflight);
+    gic_clear_pending_irqs(v);
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+}
+
 void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 {
     int idx = irq >> 2, byte = irq & 0x3;
@@ -652,8 +664,8 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
-    /* irq already pending */
-    if (!list_empty(&n->inflight))
+    /* vcpu offline or irq already pending */
+    if (test_bit(_VPF_down, &v->pause_flags) || !list_empty(&n->inflight))
     {
         spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 0f9f74b..84ebc83 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -140,12 +140,14 @@ 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 void vgic_clear_pending_irqs(struct vcpu *v);
 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 gic_clear_pending_irqs(struct vcpu *v);
 extern int gic_events_need_delivery(void);
 
 extern void __cpuinit init_maintenance_interrupt(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:04:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:04: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 1UaFH9-0007ZK-NH; Thu, 09 May 2013 01:04:03 +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 1UaFH8-0007Z1-Cm
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:02 +0000
Received: from [85.158.139.83:52902] by server-13.bemta-5.messagelabs.com id
	83/7A-08040-106FA815; Thu, 09 May 2013 01:04:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1368061440!30817934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26760 invoked from network); 9 May 2013 01:04: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;
	9 May 2013 01:04: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 1UaFH6-0000a0-0u
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFH5-0001Ra-Sj
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:59 +0000
Date: Thu, 09 May 2013 01:03:59 +0000
Message-Id: <E1UaFH5-0001Ra-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: initialize vtimer offset to
	CNTPCT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b5af4d48157d0206bcd515cb2ba4f3d4a3290d69
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:15 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:52 2013 +0100

    xen/arm: initialize vtimer offset to CNTPCT
    
    Currently we initialize the vtimer offset to
    
    CNTVCT + CNTVOFF = CNTPCT - CNTVOFF + CNTVOFF = CNTPCT
    
    Simply initialize vtimer offset to CNTPCT.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 97fe8ce..6993425 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -47,8 +47,7 @@ static void virt_timer_expired(void *data)
 int vcpu_domain_init(struct domain *d)
 {
     d->arch.phys_timer_base.offset = NOW();
-    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTVCT_EL0) +
-                                     READ_SYSREG64(CNTVOFF_EL2);
+    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:04:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:04: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 1UaFH9-0007ZK-NH; Thu, 09 May 2013 01:04:03 +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 1UaFH8-0007Z1-Cm
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:02 +0000
Received: from [85.158.139.83:52902] by server-13.bemta-5.messagelabs.com id
	83/7A-08040-106FA815; Thu, 09 May 2013 01:04:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1368061440!30817934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26760 invoked from network); 9 May 2013 01:04: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;
	9 May 2013 01:04: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 1UaFH6-0000a0-0u
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFH5-0001Ra-Sj
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:03:59 +0000
Date: Thu, 09 May 2013 01:03:59 +0000
Message-Id: <E1UaFH5-0001Ra-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: initialize vtimer offset to
	CNTPCT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b5af4d48157d0206bcd515cb2ba4f3d4a3290d69
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 8 12:41:15 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 12:59:52 2013 +0100

    xen/arm: initialize vtimer offset to CNTPCT
    
    Currently we initialize the vtimer offset to
    
    CNTVCT + CNTVOFF = CNTPCT - CNTVOFF + CNTVOFF = CNTPCT
    
    Simply initialize vtimer offset to CNTPCT.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 97fe8ce..6993425 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -47,8 +47,7 @@ static void virt_timer_expired(void *data)
 int vcpu_domain_init(struct domain *d)
 {
     d->arch.phys_timer_base.offset = NOW();
-    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTVCT_EL0) +
-                                     READ_SYSREG64(CNTVOFF_EL2);
+    d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:04:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:04:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UaFHJ-0007bJ-Qt; Thu, 09 May 2013 01: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 1UaFHI-0007b6-Qu
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:13 +0000
Received: from [85.158.139.211:5648] by server-5.bemta-5.messagelabs.com id
	E8/9C-06980-C06FA815; Thu, 09 May 2013 01:04:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1368061450!19445133!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 815 invoked from network); 9 May 2013 01:04:11 -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;
	9 May 2013 01:04: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 1UaFHG-0000aZ-8z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFHG-0001Rz-7h
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:10 +0000
Date: Thu, 09 May 2013 01:04:10 +0000
Message-Id: <E1UaFHG-0001Rz-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move
	VCPUOP_register_runstate_memory_area to 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

commit 8968bafa3170d46d21d8f6ee2d0856f270c864ad
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 1 20:32:27 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 13:01:22 2013 +0100

    xen: move VCPUOP_register_runstate_memory_area to common code
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c |   28 ----------------------------
 xen/common/domain.c   |   28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0228db2..161d1b3 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -966,34 +966,6 @@ arch_do_vcpu_op(
 
     switch ( cmd )
     {
-    case VCPUOP_register_runstate_memory_area:
-    {
-        struct vcpu_register_runstate_memory_area area;
-        struct vcpu_runstate_info runstate;
-
-        rc = -EFAULT;
-        if ( copy_from_guest(&area, arg, 1) )
-            break;
-
-        if ( !guest_handle_okay(area.addr.h, 1) )
-            break;
-
-        rc = 0;
-        runstate_guest(v) = area.addr.h;
-
-        if ( v == current )
-        {
-            __copy_to_guest(runstate_guest(v), &v->runstate, 1);
-        }
-        else
-        {
-            vcpu_runstate_get(v, &runstate);
-            __copy_to_guest(runstate_guest(v), &runstate, 1);
-        }
-
-        break;
-    }
-
     /*
      * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given
      * virtual address even when running in another domain's address space.
diff --git a/xen/common/domain.c b/xen/common/domain.c
index d0b2f2e..fac3470 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1105,6 +1105,34 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case VCPUOP_register_runstate_memory_area:
+    {
+        struct vcpu_register_runstate_memory_area area;
+        struct vcpu_runstate_info runstate;
+
+        rc = -EFAULT;
+        if ( copy_from_guest(&area, arg, 1) )
+            break;
+
+        if ( !guest_handle_okay(area.addr.h, 1) )
+            break;
+
+        rc = 0;
+        runstate_guest(v) = area.addr.h;
+
+        if ( v == current )
+        {
+            __copy_to_guest(runstate_guest(v), &v->runstate, 1);
+        }
+        else
+        {
+            vcpu_runstate_get(v, &runstate);
+            __copy_to_guest(runstate_guest(v), &runstate, 1);
+        }
+
+        break;
+    }
+
 #ifdef VCPU_TRAP_NMI
     case VCPUOP_send_nmi:
         if ( !guest_handle_is_null(arg) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:04:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:04:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UaFHJ-0007bJ-Qt; Thu, 09 May 2013 01: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 1UaFHI-0007b6-Qu
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:13 +0000
Received: from [85.158.139.211:5648] by server-5.bemta-5.messagelabs.com id
	E8/9C-06980-C06FA815; Thu, 09 May 2013 01:04:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1368061450!19445133!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 815 invoked from network); 9 May 2013 01:04:11 -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;
	9 May 2013 01:04: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 1UaFHG-0000aZ-8z
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFHG-0001Rz-7h
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:10 +0000
Date: Thu, 09 May 2013 01:04:10 +0000
Message-Id: <E1UaFHG-0001Rz-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move
	VCPUOP_register_runstate_memory_area to 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

commit 8968bafa3170d46d21d8f6ee2d0856f270c864ad
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 1 20:32:27 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 13:01:22 2013 +0100

    xen: move VCPUOP_register_runstate_memory_area to common code
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c |   28 ----------------------------
 xen/common/domain.c   |   28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0228db2..161d1b3 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -966,34 +966,6 @@ arch_do_vcpu_op(
 
     switch ( cmd )
     {
-    case VCPUOP_register_runstate_memory_area:
-    {
-        struct vcpu_register_runstate_memory_area area;
-        struct vcpu_runstate_info runstate;
-
-        rc = -EFAULT;
-        if ( copy_from_guest(&area, arg, 1) )
-            break;
-
-        if ( !guest_handle_okay(area.addr.h, 1) )
-            break;
-
-        rc = 0;
-        runstate_guest(v) = area.addr.h;
-
-        if ( v == current )
-        {
-            __copy_to_guest(runstate_guest(v), &v->runstate, 1);
-        }
-        else
-        {
-            vcpu_runstate_get(v, &runstate);
-            __copy_to_guest(runstate_guest(v), &runstate, 1);
-        }
-
-        break;
-    }
-
     /*
      * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given
      * virtual address even when running in another domain's address space.
diff --git a/xen/common/domain.c b/xen/common/domain.c
index d0b2f2e..fac3470 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1105,6 +1105,34 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case VCPUOP_register_runstate_memory_area:
+    {
+        struct vcpu_register_runstate_memory_area area;
+        struct vcpu_runstate_info runstate;
+
+        rc = -EFAULT;
+        if ( copy_from_guest(&area, arg, 1) )
+            break;
+
+        if ( !guest_handle_okay(area.addr.h, 1) )
+            break;
+
+        rc = 0;
+        runstate_guest(v) = area.addr.h;
+
+        if ( v == current )
+        {
+            __copy_to_guest(runstate_guest(v), &v->runstate, 1);
+        }
+        else
+        {
+            vcpu_runstate_get(v, &runstate);
+            __copy_to_guest(runstate_guest(v), &runstate, 1);
+        }
+
+        break;
+    }
+
 #ifdef VCPU_TRAP_NMI
     case VCPUOP_send_nmi:
         if ( !guest_handle_is_null(arg) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:04:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:04: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 1UaFHV-0007dc-Tv; Thu, 09 May 2013 01:04:25 +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 1UaFHU-0007d8-9O
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:24 +0000
Received: from [85.158.139.83:9355] by server-9.bemta-5.messagelabs.com id
	DB/94-14875-616FA815; Thu, 09 May 2013 01:04:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1368061460!31916851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29533 invoked from network); 9 May 2013 01:04:21 -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;
	9 May 2013 01:04:21 -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 1UaFHQ-0000af-G6
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFHQ-0001SO-Dg
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:20 +0000
Date: Thu, 09 May 2013 01:04:20 +0000
Message-Id: <E1UaFHQ-0001SO-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: handle the
	runstate_memory_area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3b38da86878c36a7ec3e020879a0de3f5b293d95
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 1 20:32:28 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 13:01:45 2013 +0100

    xen/arm: handle the runstate_memory_area
    
    Support VCPUOP_register_runstate_memory_area on ARM.
    Update_runstate_area on context switch.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index b22d902..9ca44ea 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -22,6 +22,7 @@
 
 #include <asm/current.h>
 #include <asm/event.h>
+#include <asm/guest_access.h>
 #include <asm/regs.h>
 #include <asm/p2m.h>
 #include <asm/irq.h>
@@ -212,16 +213,25 @@ static void ctxt_switch_to(struct vcpu *n)
     virt_timer_restore(n);
 }
 
+/* Update per-VCPU guest runstate shared memory area (if registered). */
+static void update_runstate_area(struct vcpu *v)
+{
+    if ( guest_handle_is_null(runstate_guest(v)) )
+        return;
+
+    __copy_to_guest(runstate_guest(v), &v->runstate, 1);
+}
+
 static void schedule_tail(struct vcpu *prev)
 {
     ctxt_switch_from(prev);
 
     local_irq_enable();
 
-    /* TODO
-       update_runstate_area(current);
-    */
     ctxt_switch_to(current);
+
+    if ( prev != current )
+        update_runstate_area(current);
 }
 
 static void continue_new_vcpu(struct vcpu *prev)
@@ -241,9 +251,8 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
     ASSERT(prev != next);
     ASSERT(cpumask_empty(next->vcpu_dirty_cpumask));
 
-    /* TODO
-       update_runstate_area(prev);
-    */
+    if ( prev != next )
+        update_runstate_area(prev);
 
     local_irq_disable();
 
@@ -639,6 +648,7 @@ long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
     switch ( cmd )
     {
         case VCPUOP_register_vcpu_info:
+        case VCPUOP_register_runstate_memory_area:
             return do_vcpu_op(cmd, vcpuid, arg);
         default:
             return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 01:04:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 01:04: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 1UaFHV-0007dc-Tv; Thu, 09 May 2013 01:04:25 +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 1UaFHU-0007d8-9O
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:24 +0000
Received: from [85.158.139.83:9355] by server-9.bemta-5.messagelabs.com id
	DB/94-14875-616FA815; Thu, 09 May 2013 01:04:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1368061460!31916851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29533 invoked from network); 9 May 2013 01:04:21 -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;
	9 May 2013 01:04:21 -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 1UaFHQ-0000af-G6
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaFHQ-0001SO-Dg
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 01:04:20 +0000
Date: Thu, 09 May 2013 01:04:20 +0000
Message-Id: <E1UaFHQ-0001SO-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: handle the
	runstate_memory_area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3b38da86878c36a7ec3e020879a0de3f5b293d95
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed May 1 20:32:28 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 8 13:01:45 2013 +0100

    xen/arm: handle the runstate_memory_area
    
    Support VCPUOP_register_runstate_memory_area on ARM.
    Update_runstate_area on context switch.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index b22d902..9ca44ea 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -22,6 +22,7 @@
 
 #include <asm/current.h>
 #include <asm/event.h>
+#include <asm/guest_access.h>
 #include <asm/regs.h>
 #include <asm/p2m.h>
 #include <asm/irq.h>
@@ -212,16 +213,25 @@ static void ctxt_switch_to(struct vcpu *n)
     virt_timer_restore(n);
 }
 
+/* Update per-VCPU guest runstate shared memory area (if registered). */
+static void update_runstate_area(struct vcpu *v)
+{
+    if ( guest_handle_is_null(runstate_guest(v)) )
+        return;
+
+    __copy_to_guest(runstate_guest(v), &v->runstate, 1);
+}
+
 static void schedule_tail(struct vcpu *prev)
 {
     ctxt_switch_from(prev);
 
     local_irq_enable();
 
-    /* TODO
-       update_runstate_area(current);
-    */
     ctxt_switch_to(current);
+
+    if ( prev != current )
+        update_runstate_area(current);
 }
 
 static void continue_new_vcpu(struct vcpu *prev)
@@ -241,9 +251,8 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
     ASSERT(prev != next);
     ASSERT(cpumask_empty(next->vcpu_dirty_cpumask));
 
-    /* TODO
-       update_runstate_area(prev);
-    */
+    if ( prev != next )
+        update_runstate_area(prev);
 
     local_irq_disable();
 
@@ -639,6 +648,7 @@ long do_arm_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
     switch ( cmd )
     {
         case VCPUOP_register_vcpu_info:
+        case VCPUOP_register_runstate_memory_area:
             return do_vcpu_op(cmd, vcpuid, arg);
         default:
             return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 19:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 19:55: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 1UaWvm-0004Z7-EI; Thu, 09 May 2013 19:55:10 +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 1UaWvl-0004Z2-Ns
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 19:55:10 +0000
Received: from [85.158.143.99:21543] by server-3.bemta-4.messagelabs.com id
	16/20-02015-C1FFB815; Thu, 09 May 2013 19:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1368129306!29817086!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29734 invoked from network); 9 May 2013 19:55:07 -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;
	9 May 2013 19:55: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 1UaWvh-0005lK-FY
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 19:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaWvf-0002LG-F0
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 19:55:03 +0000
Date: Thu, 09 May 2013 19:55:03 +0000
Message-Id: <E1UaWvf-0002LG-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm/shadow: remove dead code for
	avoiding Xen entries on 32-bit tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 078654af2de6733fb5b3da1e07c1962832e998c1
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu May 2 11:37:56 2013 +0100
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu May 9 13:00:26 2013 +0100

    x86/mm/shadow: remove dead code for avoiding Xen entries on 32-bit tables.
    
    All non-external-mode (==PV) guests have 4-level pagetables now that
    the PAE build of Xen is gone.
    
    This patch should have no effect, since the condition it removes could
    never be true anyway: the l2 offset of HYPERVISOR_VIRT_START on 64-bit
    Xen is much higher than any l2 offset we could have seen in the
    tables (and indeed bigger than the 'int' type, which clang was
    complaining about).  Actual compat PV guest xen entries are handled by
    the equivalent test in the 64-bit SHADOW_FOREACH_L2E() below.
    
    Reported-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.c |   49 +++++++++++++++++----------------------
 1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index a8ef75e..e216063 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1305,26 +1305,23 @@ do {                                                                    \
 
 #if GUEST_PAGING_LEVELS == 2
 
-/* 32-bit l2 on PAE/64: four pages, touch every second entry, and avoid Xen */
+/* 32-bit l2 on PAE/64: four pages, touch every second entry */
 #define SHADOW_FOREACH_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)     \
 do {                                                                      \
     int _i, _j, __done = 0;                                               \
-    int _xen = !shadow_mode_external(_dom);                               \
-    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_32_shadow);\
+    ASSERT(shadow_mode_external(_dom));                                   \
+    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_32_shadow);      \
     for ( _j = 0; _j < 4 && !__done; _j++ )                               \
     {                                                                     \
         shadow_l2e_t *_sp = sh_map_domain_page(_sl2mfn);                  \
         for ( _i = 0; _i < SHADOW_L2_PAGETABLE_ENTRIES; _i += 2 )         \
-            if ( (!(_xen))                                                \
-                 || ((_j * SHADOW_L2_PAGETABLE_ENTRIES) + _i)             \
-                 < (HYPERVISOR_VIRT_START >> SHADOW_L2_PAGETABLE_SHIFT) ) \
-            {                                                             \
-                (_sl2e) = _sp + _i;                                       \
-                if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )     \
-                    {_code}                                               \
-                if ( (__done = (_done)) ) break;                          \
-                increment_ptr_to_guest_entry(_gl2p);                      \
-            }                                                             \
+        {                                                                 \
+            (_sl2e) = _sp + _i;                                           \
+            if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )         \
+                {_code}                                                   \
+            if ( (__done = (_done)) ) break;                              \
+            increment_ptr_to_guest_entry(_gl2p);                          \
+        }                                                                 \
         sh_unmap_domain_page(_sp);                                        \
         if ( _j < 3 ) _sl2mfn = sh_next_page(_sl2mfn);                    \
     }                                                                     \
@@ -1332,26 +1329,22 @@ do {                                                                      \
 
 #elif GUEST_PAGING_LEVELS == 3
 
-/* PAE: if it's an l2h, don't touch Xen mappings */
+/* PAE: touch all entries */
 #define SHADOW_FOREACH_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)      \
 do {                                                                       \
     int _i;                                                                \
-    int _xen = !shadow_mode_external(_dom);                                \
     shadow_l2e_t *_sp = sh_map_domain_page((_sl2mfn));                     \
-    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_pae_shadow \
-           || mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2h_pae_shadow);\
+    ASSERT(shadow_mode_external(_dom));                                    \
+    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_pae_shadow        \
+           || mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2h_pae_shadow);  \
     for ( _i = 0; _i < SHADOW_L2_PAGETABLE_ENTRIES; _i++ )                 \
-        if ( (!(_xen))                                                     \
-             || mfn_to_page(_sl2mfn)->u.sh.type != SH_type_l2h_pae_shadow\
-             || ((_i + (3 * SHADOW_L2_PAGETABLE_ENTRIES))                  \
-                 < (HYPERVISOR_VIRT_START >> SHADOW_L2_PAGETABLE_SHIFT)) ) \
-        {                                                                  \
-            (_sl2e) = _sp + _i;                                            \
-            if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )          \
-                {_code}                                                    \
-            if ( _done ) break;                                            \
-            increment_ptr_to_guest_entry(_gl2p);                           \
-        }                                                                  \
+    {                                                                      \
+        (_sl2e) = _sp + _i;                                                \
+        if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )              \
+            {_code}                                                        \
+        if ( _done ) break;                                                \
+        increment_ptr_to_guest_entry(_gl2p);                               \
+    }                                                                      \
     sh_unmap_domain_page(_sp);                                             \
 } while (0)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 09 19:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 May 2013 19:55: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 1UaWvm-0004Z7-EI; Thu, 09 May 2013 19:55:10 +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 1UaWvl-0004Z2-Ns
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 19:55:10 +0000
Received: from [85.158.143.99:21543] by server-3.bemta-4.messagelabs.com id
	16/20-02015-C1FFB815; Thu, 09 May 2013 19:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1368129306!29817086!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29734 invoked from network); 9 May 2013 19:55:07 -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;
	9 May 2013 19:55: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 1UaWvh-0005lK-FY
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 19:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UaWvf-0002LG-F0
	for xen-changelog@lists.xensource.com; Thu, 09 May 2013 19:55:03 +0000
Date: Thu, 09 May 2013 19:55:03 +0000
Message-Id: <E1UaWvf-0002LG-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm/shadow: remove dead code for
	avoiding Xen entries on 32-bit tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 078654af2de6733fb5b3da1e07c1962832e998c1
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu May 2 11:37:56 2013 +0100
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu May 9 13:00:26 2013 +0100

    x86/mm/shadow: remove dead code for avoiding Xen entries on 32-bit tables.
    
    All non-external-mode (==PV) guests have 4-level pagetables now that
    the PAE build of Xen is gone.
    
    This patch should have no effect, since the condition it removes could
    never be true anyway: the l2 offset of HYPERVISOR_VIRT_START on 64-bit
    Xen is much higher than any l2 offset we could have seen in the
    tables (and indeed bigger than the 'int' type, which clang was
    complaining about).  Actual compat PV guest xen entries are handled by
    the equivalent test in the 64-bit SHADOW_FOREACH_L2E() below.
    
    Reported-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.c |   49 +++++++++++++++++----------------------
 1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index a8ef75e..e216063 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1305,26 +1305,23 @@ do {                                                                    \
 
 #if GUEST_PAGING_LEVELS == 2
 
-/* 32-bit l2 on PAE/64: four pages, touch every second entry, and avoid Xen */
+/* 32-bit l2 on PAE/64: four pages, touch every second entry */
 #define SHADOW_FOREACH_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)     \
 do {                                                                      \
     int _i, _j, __done = 0;                                               \
-    int _xen = !shadow_mode_external(_dom);                               \
-    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_32_shadow);\
+    ASSERT(shadow_mode_external(_dom));                                   \
+    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_32_shadow);      \
     for ( _j = 0; _j < 4 && !__done; _j++ )                               \
     {                                                                     \
         shadow_l2e_t *_sp = sh_map_domain_page(_sl2mfn);                  \
         for ( _i = 0; _i < SHADOW_L2_PAGETABLE_ENTRIES; _i += 2 )         \
-            if ( (!(_xen))                                                \
-                 || ((_j * SHADOW_L2_PAGETABLE_ENTRIES) + _i)             \
-                 < (HYPERVISOR_VIRT_START >> SHADOW_L2_PAGETABLE_SHIFT) ) \
-            {                                                             \
-                (_sl2e) = _sp + _i;                                       \
-                if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )     \
-                    {_code}                                               \
-                if ( (__done = (_done)) ) break;                          \
-                increment_ptr_to_guest_entry(_gl2p);                      \
-            }                                                             \
+        {                                                                 \
+            (_sl2e) = _sp + _i;                                           \
+            if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )         \
+                {_code}                                                   \
+            if ( (__done = (_done)) ) break;                              \
+            increment_ptr_to_guest_entry(_gl2p);                          \
+        }                                                                 \
         sh_unmap_domain_page(_sp);                                        \
         if ( _j < 3 ) _sl2mfn = sh_next_page(_sl2mfn);                    \
     }                                                                     \
@@ -1332,26 +1329,22 @@ do {                                                                      \
 
 #elif GUEST_PAGING_LEVELS == 3
 
-/* PAE: if it's an l2h, don't touch Xen mappings */
+/* PAE: touch all entries */
 #define SHADOW_FOREACH_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)      \
 do {                                                                       \
     int _i;                                                                \
-    int _xen = !shadow_mode_external(_dom);                                \
     shadow_l2e_t *_sp = sh_map_domain_page((_sl2mfn));                     \
-    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_pae_shadow \
-           || mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2h_pae_shadow);\
+    ASSERT(shadow_mode_external(_dom));                                    \
+    ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_pae_shadow        \
+           || mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2h_pae_shadow);  \
     for ( _i = 0; _i < SHADOW_L2_PAGETABLE_ENTRIES; _i++ )                 \
-        if ( (!(_xen))                                                     \
-             || mfn_to_page(_sl2mfn)->u.sh.type != SH_type_l2h_pae_shadow\
-             || ((_i + (3 * SHADOW_L2_PAGETABLE_ENTRIES))                  \
-                 < (HYPERVISOR_VIRT_START >> SHADOW_L2_PAGETABLE_SHIFT)) ) \
-        {                                                                  \
-            (_sl2e) = _sp + _i;                                            \
-            if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )          \
-                {_code}                                                    \
-            if ( _done ) break;                                            \
-            increment_ptr_to_guest_entry(_gl2p);                           \
-        }                                                                  \
+    {                                                                      \
+        (_sl2e) = _sp + _i;                                                \
+        if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )              \
+            {_code}                                                        \
+        if ( _done ) break;                                                \
+        increment_ptr_to_guest_entry(_gl2p);                               \
+    }                                                                      \
     sh_unmap_domain_page(_sp);                                             \
 } while (0)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 10 18:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 May 2013 18: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 1Uarmf-0004ai-Fh; Fri, 10 May 2013 18:11: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 1Uarmd-0004aZ-Ud
	for xen-changelog@lists.xensource.com; Fri, 10 May 2013 18:11:08 +0000
Received: from [193.109.254.147:7500] by server-1.bemta-14.messagelabs.com id
	3C/AB-06919-B383D815; Fri, 10 May 2013 18:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1368209465!9569616!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8260 invoked from network); 10 May 2013 18:11:06 -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;
	10 May 2013 18:11: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 1UarmY-0003LI-VO
	for xen-changelog@lists.xensource.com; Fri, 10 May 2013 18:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UarmY-00015Y-PY
	for xen-changelog@lists.xensource.com; Fri, 10 May 2013 18:11:02 +0000
Date: Fri, 10 May 2013 18:11:02 +0000
Message-Id: <E1UarmY-00015Y-PY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Change tmem maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 907d1e458d6dbd00dd4d90044b820fd7436f69cd
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri May 10 10:44:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 10 10:44:17 2013 +0200

    MAINTAINERS: Change tmem maintainer
    
    Konrad has graduated to becoming an maintainer in the Xen hypervisor.
    
    Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c672c8..b1e8d23 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -262,7 +262,7 @@ S:	Supported
 F:	tools/
 
 TRANSCENDENT MEMORY (TMEM)
-M:	Dan Magenheimer <dan.magenheimer@oracle.com>
+M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
 W:	http://oss.oracle.com/projects/tmem
 S:	Supported
 F:	xen/common/tmem*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 10 18:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 May 2013 18: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 1Uarmf-0004ai-Fh; Fri, 10 May 2013 18:11: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 1Uarmd-0004aZ-Ud
	for xen-changelog@lists.xensource.com; Fri, 10 May 2013 18:11:08 +0000
Received: from [193.109.254.147:7500] by server-1.bemta-14.messagelabs.com id
	3C/AB-06919-B383D815; Fri, 10 May 2013 18:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1368209465!9569616!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8260 invoked from network); 10 May 2013 18:11:06 -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;
	10 May 2013 18:11: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 1UarmY-0003LI-VO
	for xen-changelog@lists.xensource.com; Fri, 10 May 2013 18:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UarmY-00015Y-PY
	for xen-changelog@lists.xensource.com; Fri, 10 May 2013 18:11:02 +0000
Date: Fri, 10 May 2013 18:11:02 +0000
Message-Id: <E1UarmY-00015Y-PY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Change tmem maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 907d1e458d6dbd00dd4d90044b820fd7436f69cd
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri May 10 10:44:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 10 10:44:17 2013 +0200

    MAINTAINERS: Change tmem maintainer
    
    Konrad has graduated to becoming an maintainer in the Xen hypervisor.
    
    Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c672c8..b1e8d23 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -262,7 +262,7 @@ S:	Supported
 F:	tools/
 
 TRANSCENDENT MEMORY (TMEM)
-M:	Dan Magenheimer <dan.magenheimer@oracle.com>
+M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
 W:	http://oss.oracle.com/projects/tmem
 S:	Supported
 F:	xen/common/tmem*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15: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 1UbBS2-0002c7-3M; Sat, 11 May 2013 15:11:10 +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 1UbBS0-0002bz-SJ
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:08 +0000
Received: from [85.158.138.51:65411] by server-8.bemta-3.messagelabs.com id
	98/34-25864-B8F5E815; Sat, 11 May 2013 15:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1368285065!32422432!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7418 invoked from network); 11 May 2013 15:11:06 -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 May 2013 15:11: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 1UbBRx-0007Yl-43
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBRv-0004ZD-75
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:03 +0000
Date: Sat, 11 May 2013 15:11:03 +0000
Message-Id: <E1UbBRv-0004ZD-75@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] .gitignore: Add vim swap files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c06c4fd1721571fcd1118f4f224971ed1a65869b
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 9 17:17:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:14:50 2013 +0100

    .gitignore: Add vim swap files
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- corrected .hgignore regex syntax ]
---
 .gitignore |    1 +
 .hgignore  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6753368..960c29e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.orig
 *.rej
 *~
+*.swp
 *.o
 *.d
 *.opic
diff --git a/.hgignore b/.hgignore
index 6b432f7..f3877a9 100644
--- a/.hgignore
+++ b/.hgignore
@@ -11,6 +11,7 @@
 .*\.tar\.bz2$
 .*\.tar\.gz$
 .*~$
+.*\.swp$
 .*\.tmp$
 .*\.flc$
 .*\.orig$
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15: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 1UbBS2-0002c7-3M; Sat, 11 May 2013 15:11:10 +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 1UbBS0-0002bz-SJ
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:08 +0000
Received: from [85.158.138.51:65411] by server-8.bemta-3.messagelabs.com id
	98/34-25864-B8F5E815; Sat, 11 May 2013 15:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1368285065!32422432!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7418 invoked from network); 11 May 2013 15:11:06 -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 May 2013 15:11: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 1UbBRx-0007Yl-43
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBRv-0004ZD-75
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:03 +0000
Date: Sat, 11 May 2013 15:11:03 +0000
Message-Id: <E1UbBRv-0004ZD-75@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] .gitignore: Add vim swap files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c06c4fd1721571fcd1118f4f224971ed1a65869b
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 9 17:17:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:14:50 2013 +0100

    .gitignore: Add vim swap files
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- corrected .hgignore regex syntax ]
---
 .gitignore |    1 +
 .hgignore  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6753368..960c29e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.orig
 *.rej
 *~
+*.swp
 *.o
 *.d
 *.opic
diff --git a/.hgignore b/.hgignore
index 6b432f7..f3877a9 100644
--- a/.hgignore
+++ b/.hgignore
@@ -11,6 +11,7 @@
 .*\.tar\.bz2$
 .*\.tar\.gz$
 .*~$
+.*\.swp$
 .*\.tmp$
 .*\.flc$
 .*\.orig$
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15: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 1UbBSE-0002d4-6N; Sat, 11 May 2013 15:11: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 1UbBSC-0002ce-C4
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:20 +0000
Received: from [85.158.137.99:24798] by server-7.bemta-3.messagelabs.com id
	9E/88-10169-79F5E815; Sat, 11 May 2013 15:11:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1368285077!21345896!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18159 invoked from network); 11 May 2013 15:11:18 -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 May 2013 15:11: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 1UbBS9-0007Yo-2R
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBS7-0004Zb-At
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:15 +0000
Date: Sat, 11 May 2013 15:11:15 +0000
Message-Id: <E1UbBS7-0004Zb-At@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: cast int<->pointer via uintptr_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4413905224982918232=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b1d98d94d04cccc8703a4494abf23dbb9123b780
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri May 10 14:13:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:15:32 2013 +0100

    arm: cast int<->pointer via uintptr_t
    
    Fixes build on arm64:
    
    gic.c: In function ‘gic_irq_eoi’:
            gic.c:726:16: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
            gic.c: In function ‘maintenance_interrupt’:
            gic.c:776:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
            gic.c:778:64: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
            cc1: all warnings being treated as errors
            make[3]: *** [gic.o] Error 1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8d35e0e..9ebfebe 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -723,7 +723,7 @@ int gicv_setup(struct domain *d)
 
 static void gic_irq_eoi(void *info)
 {
-    int virq = (int) info;
+    int virq = (uintptr_t) info;
     GICC[GICC_DIR] = virq;
 }
 
@@ -773,9 +773,10 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
             /* this is not racy because we can't receive another irq of the
              * same type until we EOI it.  */
             if ( cpu == smp_processor_id() )
-                gic_irq_eoi((void*)virq);
+                gic_irq_eoi((void*)(uintptr_t)virq);
             else
-                on_selected_cpus(cpumask_of(cpu), gic_irq_eoi, (void*)virq, 0);
+                on_selected_cpus(cpumask_of(cpu),
+                                 gic_irq_eoi, (void*)(uintptr_t)virq, 0);
         }
 
         i++;
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4413905224982918232==
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
--===============4413905224982918232==--

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15: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 1UbBSE-0002d4-6N; Sat, 11 May 2013 15:11: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 1UbBSC-0002ce-C4
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:20 +0000
Received: from [85.158.137.99:24798] by server-7.bemta-3.messagelabs.com id
	9E/88-10169-79F5E815; Sat, 11 May 2013 15:11:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1368285077!21345896!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18159 invoked from network); 11 May 2013 15:11:18 -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 May 2013 15:11: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 1UbBS9-0007Yo-2R
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBS7-0004Zb-At
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:15 +0000
Date: Sat, 11 May 2013 15:11:15 +0000
Message-Id: <E1UbBS7-0004Zb-At@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: cast int<->pointer via uintptr_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4413905224982918232=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b1d98d94d04cccc8703a4494abf23dbb9123b780
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri May 10 14:13:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:15:32 2013 +0100

    arm: cast int<->pointer via uintptr_t
    
    Fixes build on arm64:
    
    gic.c: In function ‘gic_irq_eoi’:
            gic.c:726:16: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
            gic.c: In function ‘maintenance_interrupt’:
            gic.c:776:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
            gic.c:778:64: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
            cc1: all warnings being treated as errors
            make[3]: *** [gic.o] Error 1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 8d35e0e..9ebfebe 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -723,7 +723,7 @@ int gicv_setup(struct domain *d)
 
 static void gic_irq_eoi(void *info)
 {
-    int virq = (int) info;
+    int virq = (uintptr_t) info;
     GICC[GICC_DIR] = virq;
 }
 
@@ -773,9 +773,10 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
             /* this is not racy because we can't receive another irq of the
              * same type until we EOI it.  */
             if ( cpu == smp_processor_id() )
-                gic_irq_eoi((void*)virq);
+                gic_irq_eoi((void*)(uintptr_t)virq);
             else
-                on_selected_cpus(cpumask_of(cpu), gic_irq_eoi, (void*)virq, 0);
+                on_selected_cpus(cpumask_of(cpu),
+                                 gic_irq_eoi, (void*)(uintptr_t)virq, 0);
         }
 
         i++;
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============4413905224982918232==
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
--===============4413905224982918232==--

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:11: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 1UbBSO-0002dp-9K; Sat, 11 May 2013 15:11: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 1UbBSN-0002dh-HQ
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:31 +0000
Received: from [193.109.254.147:48946] by server-6.bemta-14.messagelabs.com id
	49/80-00912-2AF5E815; Sat, 11 May 2013 15:11:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1368285088!9432639!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32012 invoked from network); 11 May 2013 15:11:29 -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 May 2013 15:11: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 1UbBSJ-0007Yu-7n
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSJ-0004Zx-69
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:27 +0000
Date: Sat, 11 May 2013 15:11:27 +0000
Message-Id: <E1UbBSJ-0004Zx-69@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: lr must be included in range
	[0-nr_lr(
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1f5bee6af4a7d38990cd7c139bf79c1c213cfe74
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:47 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:00 2013 +0100

    xen/arm: lr must be included in range [0-nr_lr(
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 9ebfebe..dd902d2 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -510,7 +510,9 @@ static inline void gic_set_lr(int lr, unsigned int virtual_irq,
 {
     int maintenance_int = GICH_LR_MAINTENANCE_IRQ;
 
-    BUG_ON(lr > nr_lrs);
+    BUG_ON(lr >= nr_lrs);
+    BUG_ON(lr < 0);
+    BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
 
     GICH[GICH_LR + lr] = state |
         maintenance_int |
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:11: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 1UbBSO-0002dp-9K; Sat, 11 May 2013 15:11: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 1UbBSN-0002dh-HQ
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:31 +0000
Received: from [193.109.254.147:48946] by server-6.bemta-14.messagelabs.com id
	49/80-00912-2AF5E815; Sat, 11 May 2013 15:11:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1368285088!9432639!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32012 invoked from network); 11 May 2013 15:11:29 -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 May 2013 15:11: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 1UbBSJ-0007Yu-7n
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSJ-0004Zx-69
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:27 +0000
Date: Sat, 11 May 2013 15:11:27 +0000
Message-Id: <E1UbBSJ-0004Zx-69@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: lr must be included in range
	[0-nr_lr(
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1f5bee6af4a7d38990cd7c139bf79c1c213cfe74
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:47 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:00 2013 +0100

    xen/arm: lr must be included in range [0-nr_lr(
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 9ebfebe..dd902d2 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -510,7 +510,9 @@ static inline void gic_set_lr(int lr, unsigned int virtual_irq,
 {
     int maintenance_int = GICH_LR_MAINTENANCE_IRQ;
 
-    BUG_ON(lr > nr_lrs);
+    BUG_ON(lr >= nr_lrs);
+    BUG_ON(lr < 0);
+    BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
 
     GICH[GICH_LR + lr] = state |
         maintenance_int |
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15: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 1UbBSX-0002fI-Bx; Sat, 11 May 2013 15:11: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 1UbBSW-0002f7-U9
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:41 +0000
Received: from [85.158.139.83:17715] by server-12.bemta-5.messagelabs.com id
	4F/3F-16465-BAF5E815; Sat, 11 May 2013 15:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1368285097!32327684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26963 invoked from network); 11 May 2013 15:11:38 -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 May 2013 15:11: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 1UbBST-0007Z2-DB
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBST-0004b6-AO
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:37 +0000
Date: Sat, 11 May 2013 15:11:37 +0000
Message-Id: <E1UbBST-0004b6-AO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't allow dom0 to access to
	vpl011 UART0 memory range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0232cd2443b6bd3c7d3702ece51109207dd6bd1d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:48 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:05 2013 +0100

    xen/arm: Don't allow dom0 to access to vpl011 UART0 memory range
    
    As vpl011 UART is not initialized for dom 0, when the domain tries to access to
    this range, a segfault will occur in Xen. The right behaviour should be a data
    abort for the guest.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vpl011.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
index 9472d0a..13ba623 100644
--- a/xen/arch/arm/vpl011.c
+++ b/xen/arch/arm/vpl011.c
@@ -85,7 +85,9 @@ static void uart0_print_char(char c)
 
 static int uart0_mmio_check(struct vcpu *v, paddr_t addr)
 {
-    return addr >= UART0_START && addr < UART0_END;
+    struct domain *d = v->domain;
+
+    return d->domain_id != 0 && addr >= UART0_START && addr < UART0_END;
 }
 
 static int uart0_mmio_read(struct vcpu *v, mmio_info_t *info)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15: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 1UbBSX-0002fI-Bx; Sat, 11 May 2013 15:11: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 1UbBSW-0002f7-U9
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:41 +0000
Received: from [85.158.139.83:17715] by server-12.bemta-5.messagelabs.com id
	4F/3F-16465-BAF5E815; Sat, 11 May 2013 15:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1368285097!32327684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26963 invoked from network); 11 May 2013 15:11:38 -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 May 2013 15:11: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 1UbBST-0007Z2-DB
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBST-0004b6-AO
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:37 +0000
Date: Sat, 11 May 2013 15:11:37 +0000
Message-Id: <E1UbBST-0004b6-AO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't allow dom0 to access to
	vpl011 UART0 memory range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0232cd2443b6bd3c7d3702ece51109207dd6bd1d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:48 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:05 2013 +0100

    xen/arm: Don't allow dom0 to access to vpl011 UART0 memory range
    
    As vpl011 UART is not initialized for dom 0, when the domain tries to access to
    this range, a segfault will occur in Xen. The right behaviour should be a data
    abort for the guest.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vpl011.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
index 9472d0a..13ba623 100644
--- a/xen/arch/arm/vpl011.c
+++ b/xen/arch/arm/vpl011.c
@@ -85,7 +85,9 @@ static void uart0_print_char(char c)
 
 static int uart0_mmio_check(struct vcpu *v, paddr_t addr)
 {
-    return addr >= UART0_START && addr < UART0_END;
+    struct domain *d = v->domain;
+
+    return d->domain_id != 0 && addr >= UART0_START && addr < UART0_END;
 }
 
 static int uart0_mmio_read(struct vcpu *v, mmio_info_t *info)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:11: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 1UbBSh-0002h2-F5; Sat, 11 May 2013 15:11: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 1UbBSg-0002gj-8K
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:50 +0000
Received: from [85.158.139.211:31116] by server-8.bemta-5.messagelabs.com id
	F7/D4-29170-5BF5E815; Sat, 11 May 2013 15:11:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1368285107!18061472!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1677 invoked from network); 11 May 2013 15:11:48 -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 May 2013 15:11: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 1UbBSd-0007Z8-Jc
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSd-0004ba-Hh
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:47 +0000
Date: Sat, 11 May 2013 15:11:47 +0000
Message-Id: <E1UbBSd-0004ba-Hh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove duplicated
	GICD_ICPIDR2 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

commit 1adf4eb70370b36d18c23abf9d4bfdbd70dda3f7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:49 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:07 2013 +0100

    xen/arm: Remove duplicated GICD_ICPIDR2 definition
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/gic.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 84ebc83..3efb2b5 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -43,7 +43,6 @@
 #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)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:11:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:11: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 1UbBSh-0002h2-F5; Sat, 11 May 2013 15:11: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 1UbBSg-0002gj-8K
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:50 +0000
Received: from [85.158.139.211:31116] by server-8.bemta-5.messagelabs.com id
	F7/D4-29170-5BF5E815; Sat, 11 May 2013 15:11:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1368285107!18061472!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1677 invoked from network); 11 May 2013 15:11:48 -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 May 2013 15:11: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 1UbBSd-0007Z8-Jc
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSd-0004ba-Hh
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:47 +0000
Date: Sat, 11 May 2013 15:11:47 +0000
Message-Id: <E1UbBSd-0004ba-Hh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove duplicated
	GICD_ICPIDR2 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

commit 1adf4eb70370b36d18c23abf9d4bfdbd70dda3f7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:49 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:07 2013 +0100

    xen/arm: Remove duplicated GICD_ICPIDR2 definition
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/gic.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 84ebc83..3efb2b5 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -43,7 +43,6 @@
 #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)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBSw-0002jA-Hx; Sat, 11 May 2013 15:12: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 1UbBSr-0002iU-1C
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:02 +0000
Received: from [85.158.138.51:6694] by server-2.bemta-3.messagelabs.com id
	70/72-07011-0CF5E815; Sat, 11 May 2013 15:12:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1368285117!32073604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1591 invoked from network); 11 May 2013 15:11:58 -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 May 2013 15:11: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 1UbBSn-0007ZI-O9
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSn-0004cA-Ma
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:57 +0000
Date: Sat, 11 May 2013 15:11:57 +0000
Message-Id: <E1UbBSn-0004cA-Ma@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Bump early printk internal
	buffer to 512
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ac73c9ceff976800628f8b40a2a6f6e8afb30554
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:50 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:08 2013 +0100

    xen/arm: Bump early printk internal buffer to 512
    
    When debug is enabled in device tree code, some lines
    are bigger than 80 characters.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/early_printk.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index bdf4c0e..0f99a43 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -29,6 +29,9 @@ void __init early_putch(char c)
     *r = c;
 }
 
+/* Early printk buffer */
+static char __initdata buf[512];
+
 static void __init early_puts(const char *s)
 {
     while (*s != '\0') {
@@ -41,8 +44,6 @@ static void __init early_puts(const char *s)
 
 static void __init early_vprintk(const char *fmt, va_list args)
 {
-    char buf[80];
-
     vsnprintf(buf, sizeof(buf), fmt, args);
     early_puts(buf);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBSw-0002jA-Hx; Sat, 11 May 2013 15:12: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 1UbBSr-0002iU-1C
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:02 +0000
Received: from [85.158.138.51:6694] by server-2.bemta-3.messagelabs.com id
	70/72-07011-0CF5E815; Sat, 11 May 2013 15:12:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1368285117!32073604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1591 invoked from network); 11 May 2013 15:11:58 -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 May 2013 15:11: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 1UbBSn-0007ZI-O9
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSn-0004cA-Ma
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:11:57 +0000
Date: Sat, 11 May 2013 15:11:57 +0000
Message-Id: <E1UbBSn-0004cA-Ma@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Bump early printk internal
	buffer to 512
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ac73c9ceff976800628f8b40a2a6f6e8afb30554
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:50 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:08 2013 +0100

    xen/arm: Bump early printk internal buffer to 512
    
    When debug is enabled in device tree code, some lines
    are bigger than 80 characters.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/early_printk.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index bdf4c0e..0f99a43 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -29,6 +29,9 @@ void __init early_putch(char c)
     *r = c;
 }
 
+/* Early printk buffer */
+static char __initdata buf[512];
+
 static void __init early_puts(const char *s)
 {
     while (*s != '\0') {
@@ -41,8 +44,6 @@ static void __init early_puts(const char *s)
 
 static void __init early_vprintk(const char *fmt, va_list args)
 {
-    char buf[80];
-
     vsnprintf(buf, sizeof(buf), fmt, args);
     early_puts(buf);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UbBT1-0002kT-Ku; Sat, 11 May 2013 15:12:11 +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 1UbBT1-0002kE-0D
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:11 +0000
Received: from [85.158.139.83:18307] by server-9.bemta-5.messagelabs.com id
	B7/1D-14875-ACF5E815; Sat, 11 May 2013 15:12:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1368285128!20855072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23501 invoked from network); 11 May 2013 15:12:09 -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 May 2013 15:12: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 1UbBSx-0007Zq-UA
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSx-0004cX-SW
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:07 +0000
Date: Sat, 11 May 2013 15:12:07 +0000
Message-Id: <E1UbBSx-0004cX-SW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix early_panic when
	EARLY_PRINTK 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 f2be6b895e9b0102746bbf8c206b4be279d4943e
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:51 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:12 2013 +0100

    xen/arm: Fix early_panic when EARLY_PRINTK is disabled
    
    Even if EARLY_PRINTK is not enabled, early_panic must never return.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/early_printk.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index a770d4a..a0297a7 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -20,7 +20,7 @@ void early_panic(const char *fmt, ...) __attribute__((noreturn));
 #else
 
 static inline void early_printk(const char *fmt, ...) {}
-static inline void early_panic(const char *fmt, ...) {}
+static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...) {while(1);}
 
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UbBT1-0002kT-Ku; Sat, 11 May 2013 15:12:11 +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 1UbBT1-0002kE-0D
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:11 +0000
Received: from [85.158.139.83:18307] by server-9.bemta-5.messagelabs.com id
	B7/1D-14875-ACF5E815; Sat, 11 May 2013 15:12:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1368285128!20855072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23501 invoked from network); 11 May 2013 15:12:09 -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 May 2013 15:12: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 1UbBSx-0007Zq-UA
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBSx-0004cX-SW
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:07 +0000
Date: Sat, 11 May 2013 15:12:07 +0000
Message-Id: <E1UbBSx-0004cX-SW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix early_panic when
	EARLY_PRINTK 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 f2be6b895e9b0102746bbf8c206b4be279d4943e
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:51 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:12 2013 +0100

    xen/arm: Fix early_panic when EARLY_PRINTK is disabled
    
    Even if EARLY_PRINTK is not enabled, early_panic must never return.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/early_printk.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index a770d4a..a0297a7 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -20,7 +20,7 @@ void early_panic(const char *fmt, ...) __attribute__((noreturn));
 #else
 
 static inline void early_printk(const char *fmt, ...) {}
-static inline void early_panic(const char *fmt, ...) {}
+static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...) {while(1);}
 
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTB-0002mt-O6; Sat, 11 May 2013 15:12: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 1UbBTA-0002mZ-Sv
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:21 +0000
Received: from [193.109.254.147:53754] by server-3.bemta-14.messagelabs.com id
	D3/1A-06484-4DF5E815; Sat, 11 May 2013 15:12:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1368285138!9706671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6665 invoked from network); 11 May 2013 15:12:19 -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 May 2013 15:12: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 1UbBT8-0007Zz-3i
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBT8-0004cv-1z
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:18 +0000
Date: Sat, 11 May 2013 15:12:18 +0000
Message-Id: <E1UbBT8-0004cv-1z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Load dtb after dom0 kernel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 55eb2e2cb844a798b818fda7aac228885a064784
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:15 2013 +0100

    xen/arm: Load dtb after dom0 kernel
    
    On some setup, the first linux page table is at 0x40004000. Xen will load
    dom0 device tree at 0x4000100. In case of the device tree is big, linux will
    corrupt the device tree.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 8748272..6581492 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -407,8 +407,9 @@ int construct_dom0(struct domain *d)
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
 
-    dtb_load(&kinfo);
+    kinfo.dtb_paddr = kinfo.zimage.load_addr + kinfo.zimage.len;
     kernel_load(&kinfo);
+    dtb_load(&kinfo);
 
     discard_initial_modules();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTB-0002mt-O6; Sat, 11 May 2013 15:12: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 1UbBTA-0002mZ-Sv
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:21 +0000
Received: from [193.109.254.147:53754] by server-3.bemta-14.messagelabs.com id
	D3/1A-06484-4DF5E815; Sat, 11 May 2013 15:12:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1368285138!9706671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6665 invoked from network); 11 May 2013 15:12:19 -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 May 2013 15:12: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 1UbBT8-0007Zz-3i
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBT8-0004cv-1z
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:18 +0000
Date: Sat, 11 May 2013 15:12:18 +0000
Message-Id: <E1UbBT8-0004cv-1z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Load dtb after dom0 kernel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 55eb2e2cb844a798b818fda7aac228885a064784
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:15 2013 +0100

    xen/arm: Load dtb after dom0 kernel
    
    On some setup, the first linux page table is at 0x40004000. Xen will load
    dom0 device tree at 0x4000100. In case of the device tree is big, linux will
    corrupt the device tree.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 8748272..6581492 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -407,8 +407,9 @@ int construct_dom0(struct domain *d)
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
 
-    dtb_load(&kinfo);
+    kinfo.dtb_paddr = kinfo.zimage.load_addr + kinfo.zimage.len;
     kernel_load(&kinfo);
+    dtb_load(&kinfo);
 
     discard_initial_modules();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTL-0002p1-RV; Sat, 11 May 2013 15:12:31 +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 1UbBTK-0002of-Rh
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:30 +0000
Received: from [85.158.143.99:7368] by server-3.bemta-4.messagelabs.com id
	F2/F0-02015-DDF5E815; Sat, 11 May 2013 15:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1368285148!22801585!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5825 invoked from network); 11 May 2013 15:12:29 -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 May 2013 15:12: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 1UbBTI-0007a5-Bp
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBTI-0004dH-9O
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:28 +0000
Date: Sat, 11 May 2013 15:12:28 +0000
Message-Id: <E1UbBTI-0004dH-9O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Switch to SYS_STATE_boot
	right after console setup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6b18d3dded7f3d128d4d1a4a33e6fbc2842d2b7d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:53 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:16 2013 +0100

    xen/arm: Switch to SYS_STATE_boot right after console setup
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 59646d6..29447ef 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -435,6 +435,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
+    system_state = SYS_STATE_boot;
+
     processor_id();
 
     init_xen_time();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTL-0002p1-RV; Sat, 11 May 2013 15:12:31 +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 1UbBTK-0002of-Rh
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:30 +0000
Received: from [85.158.143.99:7368] by server-3.bemta-4.messagelabs.com id
	F2/F0-02015-DDF5E815; Sat, 11 May 2013 15:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1368285148!22801585!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5825 invoked from network); 11 May 2013 15:12:29 -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 May 2013 15:12: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 1UbBTI-0007a5-Bp
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBTI-0004dH-9O
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:28 +0000
Date: Sat, 11 May 2013 15:12:28 +0000
Message-Id: <E1UbBTI-0004dH-9O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Switch to SYS_STATE_boot
	right after console setup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6b18d3dded7f3d128d4d1a4a33e6fbc2842d2b7d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 03:17:53 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:17:16 2013 +0100

    xen/arm: Switch to SYS_STATE_boot right after console setup
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 59646d6..29447ef 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -435,6 +435,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
+    system_state = SYS_STATE_boot;
+
     processor_id();
 
     init_xen_time();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTX-0002rS-0T; Sat, 11 May 2013 15:12:43 +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 1UbBTV-0002r0-Ax
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:41 +0000
Received: from [85.158.139.211:40586] by server-16.bemta-5.messagelabs.com id
	FA/FD-31493-8EF5E815; Sat, 11 May 2013 15:12:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1368285158!18147722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23946 invoked from network); 11 May 2013 15:12:39 -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 May 2013 15:12: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 1UbBTS-0007aD-JU
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBTS-0004eJ-Gn
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:38 +0000
Date: Sat, 11 May 2013 15:12:38 +0000
Message-Id: <E1UbBTS-0004eJ-Gn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Change cd-insert docs to match
	behavior
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 723d7bfec35f8448f324d2c3427ef76acd4271b9
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri May 10 12:26:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:43:39 2013 +0100

    docs: Change cd-insert docs to match behavior
    
    xl cd-insert takes a plain file.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdtable.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 347302c..26f5025 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -181,7 +181,7 @@ struct cmd_spec cmd_table[] = {
     { "cd-insert",
       &main_cd_insert, 1, 1,
       "Insert a cdrom into a guest's cd drive",
-      "<Domain> <VirtualDevice> <type:path>",
+      "<Domain> <VirtualDevice> <path>",
     },
     { "cd-eject",
       &main_cd_eject, 1, 1,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTX-0002rS-0T; Sat, 11 May 2013 15:12:43 +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 1UbBTV-0002r0-Ax
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:41 +0000
Received: from [85.158.139.211:40586] by server-16.bemta-5.messagelabs.com id
	FA/FD-31493-8EF5E815; Sat, 11 May 2013 15:12:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1368285158!18147722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23946 invoked from network); 11 May 2013 15:12:39 -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 May 2013 15:12: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 1UbBTS-0007aD-JU
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBTS-0004eJ-Gn
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:38 +0000
Date: Sat, 11 May 2013 15:12:38 +0000
Message-Id: <E1UbBTS-0004eJ-Gn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Change cd-insert docs to match
	behavior
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 723d7bfec35f8448f324d2c3427ef76acd4271b9
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri May 10 12:26:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:43:39 2013 +0100

    docs: Change cd-insert docs to match behavior
    
    xl cd-insert takes a plain file.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdtable.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 347302c..26f5025 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -181,7 +181,7 @@ struct cmd_spec cmd_table[] = {
     { "cd-insert",
       &main_cd_insert, 1, 1,
       "Insert a cdrom into a guest's cd drive",
-      "<Domain> <VirtualDevice> <type:path>",
+      "<Domain> <VirtualDevice> <path>",
     },
     { "cd-eject",
       &main_cd_eject, 1, 1,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTg-0002tc-3N; Sat, 11 May 2013 15:12:52 +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 1UbBTf-0002tH-8k
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:51 +0000
Received: from [85.158.139.83:19114] by server-12.bemta-5.messagelabs.com id
	A1/BF-16465-2FF5E815; Sat, 11 May 2013 15:12:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1368285168!25083586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23908 invoked from network); 11 May 2013 15:12:49 -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 May 2013 15:12:49 -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 1UbBTc-0007aJ-Ng
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBTc-0004ef-MY
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:48 +0000
Date: Sat, 11 May 2013 15:12:48 +0000
Message-Id: <E1UbBTc-0004ef-MY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic_disable_cpu must be
	called with interrupts 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 017610862e55a31a5abb2a7e7da39ad628794e1e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Apr 16 14:38:27 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:54:07 2013 +0100

    xen/arm: gic_disable_cpu must be called with interrupts disabled
    
    gic_disable_cpu is only called with interrupt disabled.
    Use spin_lock instead of spin_lock_irq and check the function is
    called with interrupts disabled.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index dd902d2..1e2d493 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -421,10 +421,12 @@ void __cpuinit gic_init_secondary_cpu(void)
 /* Shut down the per-CPU GIC interface */
 void gic_disable_cpu(void)
 {
-    spin_lock_irq(&gic.lock);
+    ASSERT(!local_irq_is_enabled());
+
+    spin_lock(&gic.lock);
     gic_cpu_disable();
     gic_hyp_disable();
-    spin_unlock_irq(&gic.lock);
+    spin_unlock(&gic.lock);
 }
 
 void gic_route_ppis(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat May 11 15:12:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 May 2013 15:12: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 1UbBTg-0002tc-3N; Sat, 11 May 2013 15:12:52 +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 1UbBTf-0002tH-8k
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:51 +0000
Received: from [85.158.139.83:19114] by server-12.bemta-5.messagelabs.com id
	A1/BF-16465-2FF5E815; Sat, 11 May 2013 15:12:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1368285168!25083586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23908 invoked from network); 11 May 2013 15:12:49 -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 May 2013 15:12:49 -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 1UbBTc-0007aJ-Ng
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UbBTc-0004ef-MY
	for xen-changelog@lists.xensource.com; Sat, 11 May 2013 15:12:48 +0000
Date: Sat, 11 May 2013 15:12:48 +0000
Message-Id: <E1UbBTc-0004ef-MY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic_disable_cpu must be
	called with interrupts 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 017610862e55a31a5abb2a7e7da39ad628794e1e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Apr 16 14:38:27 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri May 10 14:54:07 2013 +0100

    xen/arm: gic_disable_cpu must be called with interrupts disabled
    
    gic_disable_cpu is only called with interrupt disabled.
    Use spin_lock instead of spin_lock_irq and check the function is
    called with interrupts disabled.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index dd902d2..1e2d493 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -421,10 +421,12 @@ void __cpuinit gic_init_secondary_cpu(void)
 /* Shut down the per-CPU GIC interface */
 void gic_disable_cpu(void)
 {
-    spin_lock_irq(&gic.lock);
+    ASSERT(!local_irq_is_enabled());
+
+    spin_lock(&gic.lock);
     gic_cpu_disable();
     gic_hyp_disable();
-    spin_unlock_irq(&gic.lock);
+    spin_unlock(&gic.lock);
 }
 
 void gic_route_ppis(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6KV-0003Qc-O1; Tue, 14 May 2013 03:55: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 1Uc6KU-0003QP-9x
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:10 +0000
Received: from [85.158.137.99:25969] by server-4.bemta-3.messagelabs.com id
	B9/56-01776-C95B1915; Tue, 14 May 2013 03:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1368503705!20950241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1616 invoked from network); 14 May 2013 03:55:06 -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;
	14 May 2013 03:55: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 1Uc6KP-0003B7-E0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6KP-0006Mh-8O
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:05 +0000
Date: Tue, 14 May 2013 03:55:05 +0000
Message-Id: <E1Uc6KP-0006Mh-8O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: make 'gmake dist-docs' work
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2569c54743c887ec6fbbba74efe56fb113b933fc
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Fri May 10 16:07:44 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 10:53:37 2013 +0100

    docs: make 'gmake dist-docs' work
    
    doc: buildsystem fixes
    
    - use correct pathes (make gmake dist-docs from toplevel directory work)
    - configure detects perl as tools/configure does
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matthew Wilson <msw@amazon.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran autogen.sh ]
---
 config/Docs.mk.in |    1 +
 docs/Makefile     |   14 +++++-------
 docs/configure    |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 docs/configure.ac |    4 +++
 4 files changed, 64 insertions(+), 9 deletions(-)

diff --git a/config/Docs.mk.in b/config/Docs.mk.in
index 024ef20..a2a72fd 100644
--- a/config/Docs.mk.in
+++ b/config/Docs.mk.in
@@ -11,3 +11,4 @@ POD2MAN             := @POD2MAN@
 POD2HTML            := @POD2HTML@
 POD2TEXT            := @POD2TEXT@
 MARKDOWN            := @MARKDOWN@
+PERL                := @PERL@
diff --git a/docs/Makefile b/docs/Makefile
index b26738c..72bd5e4 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -1,5 +1,3 @@
-#!/usr/bin/make -f
-
 XEN_ROOT=$(CURDIR)/..
 include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Docs.mk
@@ -75,7 +73,7 @@ clean:
 
 .PHONY: distclean
 distclean: clean
-	rm -rf ../config/Docs.mk config.log config.status config.cache \
+	rm -rf $(XEN_ROOT)/config/Docs.mk config.log config.status config.cache \
 		autom4te.cache
 
 .PHONY: install
@@ -88,8 +86,8 @@ install: all
 	cp -R man5 $(DESTDIR)$(MANDIR)
 	[ ! -d html ] || cp -R html $(DESTDIR)$(DOCDIR)
 
-html/index.html: $(DOC_HTML) ./gen-html-index INDEX
-	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
+html/index.html: $(DOC_HTML) $(CURDIR)/gen-html-index INDEX
+	$(PERL) -w -- $(CURDIR)/gen-html-index -i INDEX html $(DOC_HTML)
 
 html/%.html: %.markdown
 	$(INSTALL_DIR) $(@D)
@@ -123,13 +121,13 @@ else
 	@echo "pod2html not installed; skipping $<."
 endif
 
-html/hypercall/index.html: ./xen-headers
+html/hypercall/index.html: $(CURDIR)/xen-headers
 	rm -rf $(@D)
 	$(INSTALL_DIR) $(@D)
-	./xen-headers -O $(@D) \
+	$(PERL) -w $(CURDIR)/xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-x86_32 -X xen-x86_32 -X arch-arm \
-		../xen include/public include/xen/errno.h
+		$(XEN_ROOT)/xen include/public include/xen/errno.h
 
 -include html/hypercall/.deps
 
diff --git a/docs/configure b/docs/configure
index d623d19..a778bda 100755
--- a/docs/configure
+++ b/docs/configure
@@ -559,6 +559,7 @@ PACKAGE_URL='http://www.xen.org/'
 ac_unique_file="misc/xen-command-line.markdown"
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+PERL
 MARKDOWN
 POD2TEXT
 POD2HTML
@@ -613,7 +614,8 @@ FIG2DEV
 POD2MAN
 POD2HTML
 POD2TEXT
-MARKDOWN'
+MARKDOWN
+PERL'
 
 
 # Initialize some variables set by options.
@@ -1227,6 +1229,7 @@ Some influential environment variables:
   POD2HTML    Path to pod2html tool
   POD2TEXT    Path to pod2text tool
   MARKDOWN    Path to markdown tool
+  PERL        Path to Perl parser
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1701,6 +1704,8 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
+
+
     # Extract the first word of "fig2dev", so it can be a program name with args.
 set dummy fig2dev; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -1950,6 +1955,53 @@ $as_echo "$as_me: WARNING: markdown is not available so some documentation won't
 fi
 
 
+
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PERL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no"
+  ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${PERL}" = x"no"
+then
+    as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5
+fi
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/docs/configure.ac b/docs/configure.ac
index ea0552e..f0ebf00 100644
--- a/docs/configure.ac
+++ b/docs/configure.ac
@@ -10,6 +10,7 @@ AC_CONFIG_AUX_DIR([../])
 
 # M4 Macro includes
 m4_include([../m4/docs_tool.m4])
+m4_include([../m4/path_or_fail.m4])
 
 AX_DOCS_TOOL_PROG([FIG2DEV], [fig2dev])
 AX_DOCS_TOOL_PROG([POD2MAN], [pod2man])
@@ -17,4 +18,7 @@ AX_DOCS_TOOL_PROG([POD2HTML], [pod2html])
 AX_DOCS_TOOL_PROG([POD2TEXT], [pod2text])
 AX_DOCS_TOOL_PROGS([MARKDOWN], [markdown], [markdown markdown_py])
 
+AC_ARG_VAR([PERL], [Path to Perl parser])
+AX_PATH_PROG_OR_FAIL([PERL], [perl])
+
 AC_OUTPUT()
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6KV-0003Qc-O1; Tue, 14 May 2013 03:55: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 1Uc6KU-0003QP-9x
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:10 +0000
Received: from [85.158.137.99:25969] by server-4.bemta-3.messagelabs.com id
	B9/56-01776-C95B1915; Tue, 14 May 2013 03:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1368503705!20950241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1616 invoked from network); 14 May 2013 03:55:06 -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;
	14 May 2013 03:55: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 1Uc6KP-0003B7-E0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6KP-0006Mh-8O
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:05 +0000
Date: Tue, 14 May 2013 03:55:05 +0000
Message-Id: <E1Uc6KP-0006Mh-8O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: make 'gmake dist-docs' work
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2569c54743c887ec6fbbba74efe56fb113b933fc
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Fri May 10 16:07:44 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 10:53:37 2013 +0100

    docs: make 'gmake dist-docs' work
    
    doc: buildsystem fixes
    
    - use correct pathes (make gmake dist-docs from toplevel directory work)
    - configure detects perl as tools/configure does
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matthew Wilson <msw@amazon.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran autogen.sh ]
---
 config/Docs.mk.in |    1 +
 docs/Makefile     |   14 +++++-------
 docs/configure    |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 docs/configure.ac |    4 +++
 4 files changed, 64 insertions(+), 9 deletions(-)

diff --git a/config/Docs.mk.in b/config/Docs.mk.in
index 024ef20..a2a72fd 100644
--- a/config/Docs.mk.in
+++ b/config/Docs.mk.in
@@ -11,3 +11,4 @@ POD2MAN             := @POD2MAN@
 POD2HTML            := @POD2HTML@
 POD2TEXT            := @POD2TEXT@
 MARKDOWN            := @MARKDOWN@
+PERL                := @PERL@
diff --git a/docs/Makefile b/docs/Makefile
index b26738c..72bd5e4 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -1,5 +1,3 @@
-#!/usr/bin/make -f
-
 XEN_ROOT=$(CURDIR)/..
 include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Docs.mk
@@ -75,7 +73,7 @@ clean:
 
 .PHONY: distclean
 distclean: clean
-	rm -rf ../config/Docs.mk config.log config.status config.cache \
+	rm -rf $(XEN_ROOT)/config/Docs.mk config.log config.status config.cache \
 		autom4te.cache
 
 .PHONY: install
@@ -88,8 +86,8 @@ install: all
 	cp -R man5 $(DESTDIR)$(MANDIR)
 	[ ! -d html ] || cp -R html $(DESTDIR)$(DOCDIR)
 
-html/index.html: $(DOC_HTML) ./gen-html-index INDEX
-	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
+html/index.html: $(DOC_HTML) $(CURDIR)/gen-html-index INDEX
+	$(PERL) -w -- $(CURDIR)/gen-html-index -i INDEX html $(DOC_HTML)
 
 html/%.html: %.markdown
 	$(INSTALL_DIR) $(@D)
@@ -123,13 +121,13 @@ else
 	@echo "pod2html not installed; skipping $<."
 endif
 
-html/hypercall/index.html: ./xen-headers
+html/hypercall/index.html: $(CURDIR)/xen-headers
 	rm -rf $(@D)
 	$(INSTALL_DIR) $(@D)
-	./xen-headers -O $(@D) \
+	$(PERL) -w $(CURDIR)/xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-x86_32 -X xen-x86_32 -X arch-arm \
-		../xen include/public include/xen/errno.h
+		$(XEN_ROOT)/xen include/public include/xen/errno.h
 
 -include html/hypercall/.deps
 
diff --git a/docs/configure b/docs/configure
index d623d19..a778bda 100755
--- a/docs/configure
+++ b/docs/configure
@@ -559,6 +559,7 @@ PACKAGE_URL='http://www.xen.org/'
 ac_unique_file="misc/xen-command-line.markdown"
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+PERL
 MARKDOWN
 POD2TEXT
 POD2HTML
@@ -613,7 +614,8 @@ FIG2DEV
 POD2MAN
 POD2HTML
 POD2TEXT
-MARKDOWN'
+MARKDOWN
+PERL'
 
 
 # Initialize some variables set by options.
@@ -1227,6 +1229,7 @@ Some influential environment variables:
   POD2HTML    Path to pod2html tool
   POD2TEXT    Path to pod2text tool
   MARKDOWN    Path to markdown tool
+  PERL        Path to Perl parser
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1701,6 +1704,8 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
+
+
     # Extract the first word of "fig2dev", so it can be a program name with args.
 set dummy fig2dev; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -1950,6 +1955,53 @@ $as_echo "$as_me: WARNING: markdown is not available so some documentation won't
 fi
 
 
+
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PERL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no"
+  ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${PERL}" = x"no"
+then
+    as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5
+fi
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/docs/configure.ac b/docs/configure.ac
index ea0552e..f0ebf00 100644
--- a/docs/configure.ac
+++ b/docs/configure.ac
@@ -10,6 +10,7 @@ AC_CONFIG_AUX_DIR([../])
 
 # M4 Macro includes
 m4_include([../m4/docs_tool.m4])
+m4_include([../m4/path_or_fail.m4])
 
 AX_DOCS_TOOL_PROG([FIG2DEV], [fig2dev])
 AX_DOCS_TOOL_PROG([POD2MAN], [pod2man])
@@ -17,4 +18,7 @@ AX_DOCS_TOOL_PROG([POD2HTML], [pod2html])
 AX_DOCS_TOOL_PROG([POD2TEXT], [pod2text])
 AX_DOCS_TOOL_PROGS([MARKDOWN], [markdown], [markdown markdown_py])
 
+AC_ARG_VAR([PERL], [Path to Perl parser])
+AX_PATH_PROG_OR_FAIL([PERL], [perl])
+
 AC_OUTPUT()
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6Kf-0003RR-RI; Tue, 14 May 2013 03:55: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 1Uc6Ke-0003R6-8v
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:20 +0000
Received: from [85.158.137.99:26137] by server-13.bemta-3.messagelabs.com id
	B5/D8-19597-7A5B1915; Tue, 14 May 2013 03:55:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1368503717!16658009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19696 invoked from network); 14 May 2013 03:55:18 -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;
	14 May 2013 03:55: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 1Uc6Ka-0003BA-Mx
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6KZ-0006Nb-Kb
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:15 +0000
Date: Tue, 14 May 2013 03:55:15 +0000
Message-Id: <E1Uc6KZ-0006Nb-Kb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libfsimage: Fix clean and
	distclean make targets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 667d8a84b244d02e9c6a2d02d6a02fc90c2efb4e
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Fri May 10 17:33:54 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 10:57:17 2013 +0100

    tools/libfsimage: Fix clean and distclean make targets
    
    If there is a single colon for a given target and the target
    is redefined in another place (e.g. in included file) then
    make executes only new target and displays following warning:
    
    Makefile:35: warning: overriding commands for target `clean'
    tools/libfsimage/common/../../../tools/libfsimage/Rules.mk:25:
    warning: ignoring old commands for target `clean'
    
    To cope with that issue define all required targets as double-colon
    rules. Additionally, remove some redundant stuff.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libfsimage/Rules.mk        |    2 +-
 tools/libfsimage/common/Makefile |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libfsimage/Rules.mk b/tools/libfsimage/Rules.mk
index e4b2a91..8a23655 100644
--- a/tools/libfsimage/Rules.mk
+++ b/tools/libfsimage/Rules.mk
@@ -21,7 +21,7 @@ fs-install: fs-all
 $(FSLIB): $(PIC_OBJS)
 	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
 
-clean distclean:
+clean distclean::
 	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS)
 
 -include $(DEPS)
diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile
index f0ee3ab..cbd60b4 100644
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -31,8 +31,8 @@ install: all
 	$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(INCLUDEDIR)
 
-clean distclean:
-	rm -f $(PIC_OBJS) $(LIB) $(DEPS)
+clean distclean::
+	rm -f $(LIB)
 
 libfsimage.so: libfsimage.so.$(MAJOR)
 	ln -sf $< $@
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6Kf-0003RR-RI; Tue, 14 May 2013 03:55: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 1Uc6Ke-0003R6-8v
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:20 +0000
Received: from [85.158.137.99:26137] by server-13.bemta-3.messagelabs.com id
	B5/D8-19597-7A5B1915; Tue, 14 May 2013 03:55:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1368503717!16658009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19696 invoked from network); 14 May 2013 03:55:18 -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;
	14 May 2013 03:55: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 1Uc6Ka-0003BA-Mx
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6KZ-0006Nb-Kb
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:15 +0000
Date: Tue, 14 May 2013 03:55:15 +0000
Message-Id: <E1Uc6KZ-0006Nb-Kb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libfsimage: Fix clean and
	distclean make targets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 667d8a84b244d02e9c6a2d02d6a02fc90c2efb4e
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Fri May 10 17:33:54 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 10:57:17 2013 +0100

    tools/libfsimage: Fix clean and distclean make targets
    
    If there is a single colon for a given target and the target
    is redefined in another place (e.g. in included file) then
    make executes only new target and displays following warning:
    
    Makefile:35: warning: overriding commands for target `clean'
    tools/libfsimage/common/../../../tools/libfsimage/Rules.mk:25:
    warning: ignoring old commands for target `clean'
    
    To cope with that issue define all required targets as double-colon
    rules. Additionally, remove some redundant stuff.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libfsimage/Rules.mk        |    2 +-
 tools/libfsimage/common/Makefile |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libfsimage/Rules.mk b/tools/libfsimage/Rules.mk
index e4b2a91..8a23655 100644
--- a/tools/libfsimage/Rules.mk
+++ b/tools/libfsimage/Rules.mk
@@ -21,7 +21,7 @@ fs-install: fs-all
 $(FSLIB): $(PIC_OBJS)
 	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
 
-clean distclean:
+clean distclean::
 	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS)
 
 -include $(DEPS)
diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile
index f0ee3ab..cbd60b4 100644
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -31,8 +31,8 @@ install: all
 	$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(INCLUDEDIR)
 
-clean distclean:
-	rm -f $(PIC_OBJS) $(LIB) $(DEPS)
+clean distclean::
+	rm -f $(LIB)
 
 libfsimage.so: libfsimage.so.$(MAJOR)
 	ln -sf $< $@
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:55: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 1Uc6Ko-0003SJ-UQ; Tue, 14 May 2013 03:55:30 +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 1Uc6Ko-0003S8-KC
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:30 +0000
Received: from [85.158.139.83:15179] by server-7.bemta-5.messagelabs.com id
	8E/6A-12828-1B5B1915; Tue, 14 May 2013 03:55:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1368503727!30188170!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2486 invoked from network); 14 May 2013 03:55:28 -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;
	14 May 2013 03:55: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 1Uc6Kl-0003BG-5L
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Kl-0006O9-3A
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:27 +0000
Date: Tue, 14 May 2013 03:55:27 +0000
Message-Id: <E1Uc6Kl-0006O9-3A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: fix 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

commit 9b670aceff75f9d61bfe842a09520bfccb418df7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 13 12:07:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 13 12:07:40 2013 +0200

    x86/EFI: fix build
    
    ... after f6254405 ("xen/arm: compile and initialize vmap") moving the
    map_pages_to_xen() declaration.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/x86/efi/boot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 44bc7b7..117a5cb 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -8,6 +8,7 @@
 #include <xen/init.h>
 #include <xen/keyhandler.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/multiboot.h>
 #include <xen/pci_regs.h>
 #include <xen/pfn.h>
@@ -22,7 +23,6 @@
 #define __ASSEMBLY__ /* avoid pulling in ACPI stuff (conflicts with EFI) */
 #include <asm/fixmap.h>
 #undef __ASSEMBLY__
-#include <asm/mm.h>
 #include <asm/msr.h>
 #include <asm/processor.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:55: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 1Uc6Ko-0003SJ-UQ; Tue, 14 May 2013 03:55:30 +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 1Uc6Ko-0003S8-KC
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:30 +0000
Received: from [85.158.139.83:15179] by server-7.bemta-5.messagelabs.com id
	8E/6A-12828-1B5B1915; Tue, 14 May 2013 03:55:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1368503727!30188170!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2486 invoked from network); 14 May 2013 03:55:28 -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;
	14 May 2013 03:55: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 1Uc6Kl-0003BG-5L
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Kl-0006O9-3A
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:27 +0000
Date: Tue, 14 May 2013 03:55:27 +0000
Message-Id: <E1Uc6Kl-0006O9-3A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: fix 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

commit 9b670aceff75f9d61bfe842a09520bfccb418df7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 13 12:07:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 13 12:07:40 2013 +0200

    x86/EFI: fix build
    
    ... after f6254405 ("xen/arm: compile and initialize vmap") moving the
    map_pages_to_xen() declaration.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/x86/efi/boot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 44bc7b7..117a5cb 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -8,6 +8,7 @@
 #include <xen/init.h>
 #include <xen/keyhandler.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/multiboot.h>
 #include <xen/pci_regs.h>
 #include <xen/pfn.h>
@@ -22,7 +23,6 @@
 #define __ASSEMBLY__ /* avoid pulling in ACPI stuff (conflicts with EFI) */
 #include <asm/fixmap.h>
 #undef __ASSEMBLY__
-#include <asm/mm.h>
 #include <asm/msr.h>
 #include <asm/processor.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:55: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 1Uc6Kz-0003TU-1D; Tue, 14 May 2013 03:55:41 +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 1Uc6Ky-0003TL-L5
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:40 +0000
Received: from [85.158.137.99:45839] by server-14.bemta-3.messagelabs.com id
	8D/37-20016-BB5B1915; Tue, 14 May 2013 03:55:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1368503737!13472561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7880 invoked from network); 14 May 2013 03:55:38 -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;
	14 May 2013 03:55: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 1Uc6Kv-0003BO-BF
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Kv-0006OZ-8r
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:37 +0000
Date: Tue, 14 May 2013 03:55:37 +0000
Message-Id: <E1Uc6Kv-0006OZ-8r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen 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 ce2abaa5faae6662ddb93fc77b39ecf087d4c95f
Merge: 667d8a84b244d02e9c6a2d02d6a02fc90c2efb4e 9b670aceff75f9d61bfe842a09520bfccb418df7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 11:44:02 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:44:02 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/efi/boot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:55: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 1Uc6Kz-0003TU-1D; Tue, 14 May 2013 03:55:41 +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 1Uc6Ky-0003TL-L5
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:40 +0000
Received: from [85.158.137.99:45839] by server-14.bemta-3.messagelabs.com id
	8D/37-20016-BB5B1915; Tue, 14 May 2013 03:55:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1368503737!13472561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7880 invoked from network); 14 May 2013 03:55:38 -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;
	14 May 2013 03:55: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 1Uc6Kv-0003BO-BF
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Kv-0006OZ-8r
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:37 +0000
Date: Tue, 14 May 2013 03:55:37 +0000
Message-Id: <E1Uc6Kv-0006OZ-8r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen 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 ce2abaa5faae6662ddb93fc77b39ecf087d4c95f
Merge: 667d8a84b244d02e9c6a2d02d6a02fc90c2efb4e 9b670aceff75f9d61bfe842a09520bfccb418df7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 11:44:02 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:44:02 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/efi/boot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6LB-0003V0-4c; Tue, 14 May 2013 03:55: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 1Uc6L9-0003Ui-Rq
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:52 +0000
Received: from [85.158.139.83:48663] by server-12.bemta-5.messagelabs.com id
	F1/FA-16465-7C5B1915; Tue, 14 May 2013 03:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1368503747!31466866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30505 invoked from network); 14 May 2013 03:55:49 -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;
	14 May 2013 03:55:49 -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 1Uc6L5-0003BU-Hn
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6L5-0006Ov-GP
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:47 +0000
Date: Tue, 14 May 2013 03:55:47 +0000
Message-Id: <E1Uc6L5-0006Ov-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Extend create_xen_entries
	prototype to take mapping attribute
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0a6a239a61baaaac1704ccd1594ab3860181b702
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 23:59:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:51:42 2013 +0100

    xen/arm: Extend create_xen_entries prototype to take mapping attribute
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 2836cbb..bd7eb1a 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -631,7 +631,8 @@ enum xenmap_operation {
 static int create_xen_entries(enum xenmap_operation op,
                               unsigned long virt,
                               unsigned long mfn,
-                              unsigned long nr_mfns)
+                              unsigned long nr_mfns,
+                              unsigned int ai)
 {
     int rc;
     unsigned long addr = virt, addr_end = addr + nr_mfns * PAGE_SIZE;
@@ -664,6 +665,7 @@ static int create_xen_entries(enum xenmap_operation op,
                 }
                 pte = mfn_to_xen_entry(mfn);
                 pte.pt.table = 1;
+                pte.pt.ai = ai;
                 write_pte(&third[third_table_offset(addr)], pte);
                 break;
             case REMOVE:
@@ -693,12 +695,11 @@ int map_pages_to_xen(unsigned long virt,
                      unsigned long nr_mfns,
                      unsigned int flags)
 {
-    ASSERT(flags == PAGE_HYPERVISOR);
-    return create_xen_entries(INSERT, virt, mfn, nr_mfns);
+    return create_xen_entries(INSERT, virt, mfn, nr_mfns, flags);
 }
 void destroy_xen_mappings(unsigned long v, unsigned long e)
 {
-    create_xen_entries(REMOVE, v, 0, (e - v) >> PAGE_SHIFT);
+    create_xen_entries(REMOVE, v, 0, (e - v) >> PAGE_SHIFT, 0);
 }
 
 enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:55:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6LB-0003V0-4c; Tue, 14 May 2013 03:55: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 1Uc6L9-0003Ui-Rq
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:52 +0000
Received: from [85.158.139.83:48663] by server-12.bemta-5.messagelabs.com id
	F1/FA-16465-7C5B1915; Tue, 14 May 2013 03:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1368503747!31466866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30505 invoked from network); 14 May 2013 03:55:49 -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;
	14 May 2013 03:55:49 -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 1Uc6L5-0003BU-Hn
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6L5-0006Ov-GP
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:47 +0000
Date: Tue, 14 May 2013 03:55:47 +0000
Message-Id: <E1Uc6L5-0006Ov-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Extend create_xen_entries
	prototype to take mapping attribute
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0a6a239a61baaaac1704ccd1594ab3860181b702
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 23:59:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:51:42 2013 +0100

    xen/arm: Extend create_xen_entries prototype to take mapping attribute
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 2836cbb..bd7eb1a 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -631,7 +631,8 @@ enum xenmap_operation {
 static int create_xen_entries(enum xenmap_operation op,
                               unsigned long virt,
                               unsigned long mfn,
-                              unsigned long nr_mfns)
+                              unsigned long nr_mfns,
+                              unsigned int ai)
 {
     int rc;
     unsigned long addr = virt, addr_end = addr + nr_mfns * PAGE_SIZE;
@@ -664,6 +665,7 @@ static int create_xen_entries(enum xenmap_operation op,
                 }
                 pte = mfn_to_xen_entry(mfn);
                 pte.pt.table = 1;
+                pte.pt.ai = ai;
                 write_pte(&third[third_table_offset(addr)], pte);
                 break;
             case REMOVE:
@@ -693,12 +695,11 @@ int map_pages_to_xen(unsigned long virt,
                      unsigned long nr_mfns,
                      unsigned int flags)
 {
-    ASSERT(flags == PAGE_HYPERVISOR);
-    return create_xen_entries(INSERT, virt, mfn, nr_mfns);
+    return create_xen_entries(INSERT, virt, mfn, nr_mfns, flags);
 }
 void destroy_xen_mappings(unsigned long v, unsigned long e)
 {
-    create_xen_entries(REMOVE, v, 0, (e - v) >> PAGE_SHIFT);
+    create_xen_entries(REMOVE, v, 0, (e - v) >> PAGE_SHIFT, 0);
 }
 
 enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6LL-0003Wt-7x; Tue, 14 May 2013 03:56:03 +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 1Uc6LI-0003WH-SE
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:00 +0000
Received: from [85.158.139.211:17871] by server-13.bemta-5.messagelabs.com id
	29/F2-08040-0D5B1915; Tue, 14 May 2013 03:56:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1368503758!22944564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23123 invoked from network); 14 May 2013 03:55:59 -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;
	14 May 2013 03:55: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 1Uc6LF-0003Bd-OK
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6LF-0006PH-MG
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:57 +0000
Date: Tue, 14 May 2013 03:55:57 +0000
Message-Id: <E1Uc6LF-0006PH-MG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/mm: Align virtual address on
	PAGE_SIZE in iounmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 73a6a932d6e927c4608a8726987a3e89545d7bee
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 17:22:16 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:43 2013 +0100

    xen/mm: Align virtual address on PAGE_SIZE in iounmap
    
    ioremap function can unlikely return an unaligned virtual address if
    the physical address itself is unaligned on a page size.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    [ ijc -- include asm/page.h to fix build error on x86 ]
---
 xen/include/xen/vmap.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index 88e5d99..b1923dd 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -2,6 +2,7 @@
 #define __XEN_VMAP_H__
 
 #include <xen/types.h>
+#include <asm/page.h>
 
 void *vm_alloc(unsigned int nr, unsigned int align);
 void vm_free(const void *);
@@ -15,7 +16,9 @@ void __iomem *ioremap(paddr_t, size_t);
 
 static inline void iounmap(void __iomem *va)
 {
-    vunmap((void __force *)va);
+    unsigned long addr = (unsigned long)(void __force *)va;
+
+    vunmap((void *)(addr & PAGE_MASK));
 }
 
 void vm_init(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6LL-0003Wt-7x; Tue, 14 May 2013 03:56:03 +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 1Uc6LI-0003WH-SE
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:00 +0000
Received: from [85.158.139.211:17871] by server-13.bemta-5.messagelabs.com id
	29/F2-08040-0D5B1915; Tue, 14 May 2013 03:56:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1368503758!22944564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23123 invoked from network); 14 May 2013 03:55:59 -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;
	14 May 2013 03:55: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 1Uc6LF-0003Bd-OK
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6LF-0006PH-MG
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:55:57 +0000
Date: Tue, 14 May 2013 03:55:57 +0000
Message-Id: <E1Uc6LF-0006PH-MG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/mm: Align virtual address on
	PAGE_SIZE in iounmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 73a6a932d6e927c4608a8726987a3e89545d7bee
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 17:22:16 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:43 2013 +0100

    xen/mm: Align virtual address on PAGE_SIZE in iounmap
    
    ioremap function can unlikely return an unaligned virtual address if
    the physical address itself is unaligned on a page size.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    [ ijc -- include asm/page.h to fix build error on x86 ]
---
 xen/include/xen/vmap.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index 88e5d99..b1923dd 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -2,6 +2,7 @@
 #define __XEN_VMAP_H__
 
 #include <xen/types.h>
+#include <asm/page.h>
 
 void *vm_alloc(unsigned int nr, unsigned int align);
 void vm_free(const void *);
@@ -15,7 +16,9 @@ void __iomem *ioremap(paddr_t, size_t);
 
 static inline void iounmap(void __iomem *va)
 {
-    vunmap((void __force *)va);
+    unsigned long addr = (unsigned long)(void __force *)va;
+
+    vunmap((void *)(addr & PAGE_MASK));
 }
 
 void vm_init(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6LU-0003YQ-B7; Tue, 14 May 2013 03:56:12 +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 1Uc6LT-0003YF-9b
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:11 +0000
Received: from [85.158.143.99:23565] by server-3.bemta-4.messagelabs.com id
	B2/12-02015-AD5B1915; Tue, 14 May 2013 03:56:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1368503768!25192823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4365 invoked from network); 14 May 2013 03:56:09 -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;
	14 May 2013 03:56: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 1Uc6LP-0003CC-Uk
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6LP-0006Pe-T0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:07 +0000
Date: Tue, 14 May 2013 03:56:07 +0000
Message-Id: <E1Uc6LP-0006Pe-T0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce ioremap_attr,
	ioremap_cache, ioremap_nocache, ioremap_wc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4e6714686495f5446c85228aaa6ffe525029d4e3
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 23:33:23 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:56 2013 +0100

    xen/arm: Introduce ioremap_attr, ioremap_cache, ioremap_nocache, ioremap_wc
    
    Map physical range in virtual memory with a specific mapping attribute.
    Also add new mapping attributes for ARM: PAGE_HYPERVISOR_NOCACHE
    and PAGE_HYPERVISOR_WC.
    
    This function replaces early_ioremap which is only able to deal with 2Mb
    aligned mapping. Therefore, vmap initialization has been moved earlier.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c             |   48 +++++++++++-----------------------------
 xen/arch/arm/setup.c          |    4 +-
 xen/drivers/video/arm_hdlcd.c |    2 +-
 xen/include/asm-arm/mm.h      |   19 ++++++++++++++-
 xen/include/asm-arm/page.h    |    2 +
 5 files changed, 35 insertions(+), 40 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index bd7eb1a..d1290cd 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -38,6 +38,7 @@
 #include <xen/sched.h>
 #include <xen/vmap.h>
 #include <xsm/xsm.h>
+#include <xen/pfn.h>
 
 struct domain *dom_xen, *dom_io, *dom_cow;
 
@@ -567,45 +568,22 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
-/* Map the physical memory range start -  start + len into virtual
- * memory and return the virtual address of the mapping.
- * start has to be 2MB aligned.
- * len has to be < VMAP_VIRT_END - VMAP_VIRT_START.
- */
-static __initdata unsigned long early_vmap_start = VMAP_VIRT_END;
-void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
+void *__init arch_vmap_virt_end(void)
 {
-    paddr_t end = start + len;
-    unsigned long map_start;
-
-    len = (len + SECOND_SIZE - 1) & ~SECOND_MASK;
-    early_vmap_start -= len;
-
-    ASSERT(!(start & (~SECOND_MASK)));
-    ASSERT(!(early_vmap_start & (~SECOND_MASK)));
-
-    /* The range we need to map is too big */
-    if ( early_vmap_start >= VMAP_VIRT_START )
-        return NULL;
-
-    map_start = early_vmap_start;
-    while ( start < end )
-    {
-        lpae_t e = mfn_to_xen_entry(start >> PAGE_SHIFT);
-        e.pt.ai = attributes;
-        write_pte(xen_second + second_table_offset(map_start), e);
-
-        start += SECOND_SIZE;
-        map_start += SECOND_SIZE;
-    }
-    flush_xen_data_tlb_range_va(early_vmap_start, len);
-
-    return (void*)early_vmap_start;
+    return (void *)VMAP_VIRT_END;
 }
 
-void *__init arch_vmap_virt_end(void)
+/*
+ * This function should only be used to remap device address ranges
+ * TODO: add a check to verify this assumption
+ */
+void *ioremap_attr(paddr_t pa, size_t len, unsigned int attributes)
 {
-    return (void *)early_vmap_start;
+    unsigned long pfn = PFN_DOWN(pa);
+    unsigned int offs = pa & (PAGE_SIZE - 1);
+    unsigned int nr = PFN_UP(offs + len);
+
+    return (__vmap(&pfn, nr, 1, 1, attributes) + offs);
 }
 
 static int create_xen_table(lpae_t *entry)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 29447ef..a667db4 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -429,6 +429,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     setup_pagetables(boot_phys_offset, get_xen_paddr());
     setup_mm(fdt_paddr, fdt_size);
 
+    vm_init();
+
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
     pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
@@ -483,8 +485,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     console_init_postirq();
 
-    vm_init();
-
     do_presmp_initcalls();
 
     for_each_present_cpu ( i )
diff --git a/xen/drivers/video/arm_hdlcd.c b/xen/drivers/video/arm_hdlcd.c
index d0ec13d..72979ea 100644
--- a/xen/drivers/video/arm_hdlcd.c
+++ b/xen/drivers/video/arm_hdlcd.c
@@ -211,7 +211,7 @@ void __init video_init(void)
 
     printk(KERN_INFO "Initializing HDLCD driver\n");
 
-    lfb = early_ioremap(framebuffer_start, framebuffer_size, DEV_WC);
+    lfb = ioremap_wc(framebuffer_start, framebuffer_size);
     if ( !lfb )
     {
         printk(KERN_ERR "Couldn't map the framebuffer\n");
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 26c271e..63e1069 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -153,8 +153,23 @@ extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
 extern void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes);
 /* Remove a mapping from a fixmap entry */
 extern void clear_fixmap(unsigned map);
-/* map a 2MB aligned physical range in virtual memory. */
-void* early_ioremap(paddr_t start, size_t len, unsigned attributes);
+/* map a physical range in virtual memory */
+void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned attributes);
+
+static inline void __iomem *ioremap_nocache(paddr_t start, size_t len)
+{
+    return ioremap_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
+}
+
+static inline void __iomem *ioremap_cache(paddr_t start, size_t len)
+{
+    return ioremap_attr(start, len, PAGE_HYPERVISOR);
+}
+
+static inline void __iomem *ioremap_wc(paddr_t start, size_t len)
+{
+    return ioremap_attr(start, len, PAGE_HYPERVISOR_WC);
+}
 
 #define mfn_valid(mfn)        ({                                              \
     unsigned long __m_f_n = (mfn);                                            \
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index fd6946e..13fbd78 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -59,6 +59,8 @@
 #define DEV_CACHED    WRITEBACK
 
 #define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR_NOCACHE (DEV_SHARED)
+#define PAGE_HYPERVISOR_WC      (DEV_WC)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6LU-0003YQ-B7; Tue, 14 May 2013 03:56:12 +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 1Uc6LT-0003YF-9b
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:11 +0000
Received: from [85.158.143.99:23565] by server-3.bemta-4.messagelabs.com id
	B2/12-02015-AD5B1915; Tue, 14 May 2013 03:56:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1368503768!25192823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4365 invoked from network); 14 May 2013 03:56:09 -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;
	14 May 2013 03:56: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 1Uc6LP-0003CC-Uk
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6LP-0006Pe-T0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:07 +0000
Date: Tue, 14 May 2013 03:56:07 +0000
Message-Id: <E1Uc6LP-0006Pe-T0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce ioremap_attr,
	ioremap_cache, ioremap_nocache, ioremap_wc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4e6714686495f5446c85228aaa6ffe525029d4e3
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 23:33:23 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:56 2013 +0100

    xen/arm: Introduce ioremap_attr, ioremap_cache, ioremap_nocache, ioremap_wc
    
    Map physical range in virtual memory with a specific mapping attribute.
    Also add new mapping attributes for ARM: PAGE_HYPERVISOR_NOCACHE
    and PAGE_HYPERVISOR_WC.
    
    This function replaces early_ioremap which is only able to deal with 2Mb
    aligned mapping. Therefore, vmap initialization has been moved earlier.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c             |   48 +++++++++++-----------------------------
 xen/arch/arm/setup.c          |    4 +-
 xen/drivers/video/arm_hdlcd.c |    2 +-
 xen/include/asm-arm/mm.h      |   19 ++++++++++++++-
 xen/include/asm-arm/page.h    |    2 +
 5 files changed, 35 insertions(+), 40 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index bd7eb1a..d1290cd 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -38,6 +38,7 @@
 #include <xen/sched.h>
 #include <xen/vmap.h>
 #include <xsm/xsm.h>
+#include <xen/pfn.h>
 
 struct domain *dom_xen, *dom_io, *dom_cow;
 
@@ -567,45 +568,22 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
-/* Map the physical memory range start -  start + len into virtual
- * memory and return the virtual address of the mapping.
- * start has to be 2MB aligned.
- * len has to be < VMAP_VIRT_END - VMAP_VIRT_START.
- */
-static __initdata unsigned long early_vmap_start = VMAP_VIRT_END;
-void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
+void *__init arch_vmap_virt_end(void)
 {
-    paddr_t end = start + len;
-    unsigned long map_start;
-
-    len = (len + SECOND_SIZE - 1) & ~SECOND_MASK;
-    early_vmap_start -= len;
-
-    ASSERT(!(start & (~SECOND_MASK)));
-    ASSERT(!(early_vmap_start & (~SECOND_MASK)));
-
-    /* The range we need to map is too big */
-    if ( early_vmap_start >= VMAP_VIRT_START )
-        return NULL;
-
-    map_start = early_vmap_start;
-    while ( start < end )
-    {
-        lpae_t e = mfn_to_xen_entry(start >> PAGE_SHIFT);
-        e.pt.ai = attributes;
-        write_pte(xen_second + second_table_offset(map_start), e);
-
-        start += SECOND_SIZE;
-        map_start += SECOND_SIZE;
-    }
-    flush_xen_data_tlb_range_va(early_vmap_start, len);
-
-    return (void*)early_vmap_start;
+    return (void *)VMAP_VIRT_END;
 }
 
-void *__init arch_vmap_virt_end(void)
+/*
+ * This function should only be used to remap device address ranges
+ * TODO: add a check to verify this assumption
+ */
+void *ioremap_attr(paddr_t pa, size_t len, unsigned int attributes)
 {
-    return (void *)early_vmap_start;
+    unsigned long pfn = PFN_DOWN(pa);
+    unsigned int offs = pa & (PAGE_SIZE - 1);
+    unsigned int nr = PFN_UP(offs + len);
+
+    return (__vmap(&pfn, nr, 1, 1, attributes) + offs);
 }
 
 static int create_xen_table(lpae_t *entry)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 29447ef..a667db4 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -429,6 +429,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     setup_pagetables(boot_phys_offset, get_xen_paddr());
     setup_mm(fdt_paddr, fdt_size);
 
+    vm_init();
+
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
     pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
@@ -483,8 +485,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     console_init_postirq();
 
-    vm_init();
-
     do_presmp_initcalls();
 
     for_each_present_cpu ( i )
diff --git a/xen/drivers/video/arm_hdlcd.c b/xen/drivers/video/arm_hdlcd.c
index d0ec13d..72979ea 100644
--- a/xen/drivers/video/arm_hdlcd.c
+++ b/xen/drivers/video/arm_hdlcd.c
@@ -211,7 +211,7 @@ void __init video_init(void)
 
     printk(KERN_INFO "Initializing HDLCD driver\n");
 
-    lfb = early_ioremap(framebuffer_start, framebuffer_size, DEV_WC);
+    lfb = ioremap_wc(framebuffer_start, framebuffer_size);
     if ( !lfb )
     {
         printk(KERN_ERR "Couldn't map the framebuffer\n");
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 26c271e..63e1069 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -153,8 +153,23 @@ extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
 extern void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes);
 /* Remove a mapping from a fixmap entry */
 extern void clear_fixmap(unsigned map);
-/* map a 2MB aligned physical range in virtual memory. */
-void* early_ioremap(paddr_t start, size_t len, unsigned attributes);
+/* map a physical range in virtual memory */
+void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned attributes);
+
+static inline void __iomem *ioremap_nocache(paddr_t start, size_t len)
+{
+    return ioremap_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
+}
+
+static inline void __iomem *ioremap_cache(paddr_t start, size_t len)
+{
+    return ioremap_attr(start, len, PAGE_HYPERVISOR);
+}
+
+static inline void __iomem *ioremap_wc(paddr_t start, size_t len)
+{
+    return ioremap_attr(start, len, PAGE_HYPERVISOR_WC);
+}
 
 #define mfn_valid(mfn)        ({                                              \
     unsigned long __m_f_n = (mfn);                                            \
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index fd6946e..13fbd78 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -59,6 +59,8 @@
 #define DEV_CACHED    WRITEBACK
 
 #define PAGE_HYPERVISOR         (MATTR_MEM)
+#define PAGE_HYPERVISOR_NOCACHE (DEV_SHARED)
+#define PAGE_HYPERVISOR_WC      (DEV_WC)
 #define MAP_SMALL_PAGES         PAGE_HYPERVISOR
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6Lj-0003bL-Gi; Tue, 14 May 2013 03:56: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 1Uc6Lh-0003ar-PC
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:26 +0000
Received: from [85.158.137.99:27441] by server-7.bemta-3.messagelabs.com id
	65/08-10169-4E5B1915; Tue, 14 May 2013 03:56:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1368503778!17037316!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14074 invoked from network); 14 May 2013 03:56:19 -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;
	14 May 2013 03:56: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 1Uc6La-0003CJ-6Z
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6La-0006Ql-2H
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:18 +0000
Date: Tue, 14 May 2013 03:56:18 +0000
Message-Id: <E1Uc6La-0006Ql-2H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers ioreadl/iowritel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 11eedee7ccbc8c49b4035d342ffd3524ba0684a5
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 17:24:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers ioreadl/iowritel
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/arm32/io.h |   46 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/arm64/io.h |   38 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/mm.h       |    8 +++++++
 3 files changed, 92 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-arm/arm32/io.h b/xen/include/asm-arm/arm32/io.h
new file mode 100644
index 0000000..ec7e0ff
--- /dev/null
+++ b/xen/include/asm-arm/arm32/io.h
@@ -0,0 +1,46 @@
+/*
+ *  Based on linux arch/arm/include/asm/io.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.
+ *
+ * Modifications:
+ *  16-Sep-1996        RMK     Inlined the inx/outx functions & optimised for both
+ *                     constant addresses and variable addresses.
+ *  04-Dec-1997        RMK     Moved a lot of this stuff to the new architecture
+ *                     specific IO header files.
+ *  27-Mar-1999        PJB     Second parameter of memcpy_toio is const..
+ *  04-Apr-1999        PJB     Added check_signature.
+ *  12-Dec-1999        RMK     More cleanups
+ *  18-Jun-2000 RMK    Removed virt_to_* and friends definitions
+ *  05-Oct-2004 BJD     Moved memory string functions to use void __iomem
+ */
+#ifndef _ARM_ARM32_IO_H
+#define _ARM_ARM32_IO_H
+
+#include <asm/system.h>
+
+static inline uint32_t ioreadl(const volatile void __iomem *addr)
+{
+    uint32_t val;
+
+    asm volatile("ldr %1, %0"
+                 : "+Qo" (*(volatile uint32_t __force *)addr),
+                   "=r" (val));
+    dsb();
+
+    return val;
+}
+
+static inline void iowritel(const volatile void __iomem *addr, uint32_t val)
+{
+    dsb();
+    asm volatile("str %1, %0"
+                 : "+Qo" (*(volatile uint32_t __force *)addr)
+                 : "r" (val));
+}
+
+#endif /* _ARM_ARM32_IO_H */
diff --git a/xen/include/asm-arm/arm64/io.h b/xen/include/asm-arm/arm64/io.h
new file mode 100644
index 0000000..ec041cd
--- /dev/null
+++ b/xen/include/asm-arm/arm64/io.h
@@ -0,0 +1,38 @@
+/*
+ * Based on linux arch/arm64/include/asm/io.h
+ *
+ * Copyright (C) 1996-2000 Russell King
+ * Copyright (C) 2012 ARM Ltd.
+ *
+ * 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 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 General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef _ARM_ARM64_IO_H
+#define _ARM_ARM64_IO_H
+
+static inline uint32_t ioreadl(const volatile void __iomem *addr)
+{
+    uint32_t val;
+
+    asm volatile("ldr %w0, [%1]" : "=r" (val) : "r" (addr));
+    dsb();
+
+    return val;
+}
+
+static inline void iowritel(const volatile void __iomem *addr, uint32_t val)
+{
+    dsb();
+    asm volatile("str %w0, [%1]" : : "r" (val), "r" (addr));
+}
+
+#endif /* _ARM_ARM64_IO_H */
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 63e1069..5e7c5a3 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -6,6 +6,14 @@
 #include <asm/page.h>
 #include <public/xen.h>
 
+#if defined(CONFIG_ARM_32)
+# include <asm/arm32/io.h>
+#elif defined(CONFIG_ARM_64)
+# include <asm/arm64/io.h>
+#else
+# error "unknown ARM variant"
+#endif
+
 /* Align Xen to a 2 MiB boundary. */
 #define XEN_PADDR_ALIGN (1 << 21)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6Lj-0003bL-Gi; Tue, 14 May 2013 03:56: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 1Uc6Lh-0003ar-PC
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:26 +0000
Received: from [85.158.137.99:27441] by server-7.bemta-3.messagelabs.com id
	65/08-10169-4E5B1915; Tue, 14 May 2013 03:56:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1368503778!17037316!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14074 invoked from network); 14 May 2013 03:56:19 -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;
	14 May 2013 03:56: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 1Uc6La-0003CJ-6Z
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6La-0006Ql-2H
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:18 +0000
Date: Tue, 14 May 2013 03:56:18 +0000
Message-Id: <E1Uc6La-0006Ql-2H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers ioreadl/iowritel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 11eedee7ccbc8c49b4035d342ffd3524ba0684a5
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 10 17:24:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers ioreadl/iowritel
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/arm32/io.h |   46 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/arm64/io.h |   38 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/mm.h       |    8 +++++++
 3 files changed, 92 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-arm/arm32/io.h b/xen/include/asm-arm/arm32/io.h
new file mode 100644
index 0000000..ec7e0ff
--- /dev/null
+++ b/xen/include/asm-arm/arm32/io.h
@@ -0,0 +1,46 @@
+/*
+ *  Based on linux arch/arm/include/asm/io.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.
+ *
+ * Modifications:
+ *  16-Sep-1996        RMK     Inlined the inx/outx functions & optimised for both
+ *                     constant addresses and variable addresses.
+ *  04-Dec-1997        RMK     Moved a lot of this stuff to the new architecture
+ *                     specific IO header files.
+ *  27-Mar-1999        PJB     Second parameter of memcpy_toio is const..
+ *  04-Apr-1999        PJB     Added check_signature.
+ *  12-Dec-1999        RMK     More cleanups
+ *  18-Jun-2000 RMK    Removed virt_to_* and friends definitions
+ *  05-Oct-2004 BJD     Moved memory string functions to use void __iomem
+ */
+#ifndef _ARM_ARM32_IO_H
+#define _ARM_ARM32_IO_H
+
+#include <asm/system.h>
+
+static inline uint32_t ioreadl(const volatile void __iomem *addr)
+{
+    uint32_t val;
+
+    asm volatile("ldr %1, %0"
+                 : "+Qo" (*(volatile uint32_t __force *)addr),
+                   "=r" (val));
+    dsb();
+
+    return val;
+}
+
+static inline void iowritel(const volatile void __iomem *addr, uint32_t val)
+{
+    dsb();
+    asm volatile("str %1, %0"
+                 : "+Qo" (*(volatile uint32_t __force *)addr)
+                 : "r" (val));
+}
+
+#endif /* _ARM_ARM32_IO_H */
diff --git a/xen/include/asm-arm/arm64/io.h b/xen/include/asm-arm/arm64/io.h
new file mode 100644
index 0000000..ec041cd
--- /dev/null
+++ b/xen/include/asm-arm/arm64/io.h
@@ -0,0 +1,38 @@
+/*
+ * Based on linux arch/arm64/include/asm/io.h
+ *
+ * Copyright (C) 1996-2000 Russell King
+ * Copyright (C) 2012 ARM Ltd.
+ *
+ * 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 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 General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef _ARM_ARM64_IO_H
+#define _ARM_ARM64_IO_H
+
+static inline uint32_t ioreadl(const volatile void __iomem *addr)
+{
+    uint32_t val;
+
+    asm volatile("ldr %w0, [%1]" : "=r" (val) : "r" (addr));
+    dsb();
+
+    return val;
+}
+
+static inline void iowritel(const volatile void __iomem *addr, uint32_t val)
+{
+    dsb();
+    asm volatile("str %w0, [%1]" : : "r" (val), "r" (addr));
+}
+
+#endif /* _ARM_ARM64_IO_H */
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 63e1069..5e7c5a3 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -6,6 +6,14 @@
 #include <asm/page.h>
 #include <public/xen.h>
 
+#if defined(CONFIG_ARM_32)
+# include <asm/arm32/io.h>
+#elif defined(CONFIG_ARM_64)
+# include <asm/arm64/io.h>
+#else
+# error "unknown ARM variant"
+#endif
+
 /* Align Xen to a 2 MiB boundary. */
 #define XEN_PADDR_ALIGN (1 << 21)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6Lr-0003dB-KY; Tue, 14 May 2013 03:56: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 1Uc6Lq-0003cm-2V
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:34 +0000
Received: from [193.109.254.147:13815] by server-6.bemta-14.messagelabs.com id
	B8/6C-00912-1F5B1915; Tue, 14 May 2013 03:56:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1368503788!9066819!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19273 invoked from network); 14 May 2013 03:56:30 -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;
	14 May 2013 03: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 1Uc6Lk-0003CQ-Ci
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Lk-0006RB-BE
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:28 +0000
Date: Tue, 14 May 2013 03:56:28 +0000
Message-Id: <E1Uc6Lk-0006RB-BE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Create a hierarchical device
	tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fb97eb614acfbcc812098bbbe5dde99271fe0a0d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 15:57:22 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Create a hierarchical device tree
    
    Add function to parse the device tree and create a hierarchical tree.
    
    This code is based on drivers/of/base.c in linux source.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c          |    1 +
 xen/common/device_tree.c      |  455 ++++++++++++++++++++++++++++++++++++++++-
 xen/include/xen/device_tree.h |   89 ++++++++
 3 files changed, 540 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a667db4..81bc956 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -430,6 +430,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     setup_mm(fdt_paddr, fdt_size);
 
     vm_init();
+    dt_unflatten_host_device_tree();
 
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 7997f41..215feb1 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -2,6 +2,8 @@
  * Device Tree
  *
  * Copyright (C) 2012 Citrix Systems, Inc.
+ * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
+ * benh@kernel.crashing.org
  *
  * 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
@@ -19,14 +21,56 @@
 #include <xen/stdarg.h>
 #include <xen/string.h>
 #include <xen/cpumask.h>
+#include <xen/ctype.h>
+#include <xen/lib.h>
 #include <asm/early_printk.h>
 
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
+/* Host device tree */
+struct dt_device_node *dt_host;
+
+/**
+ * struct dt_alias_prop - Alias property in 'aliases' node
+ * @link: List node to link the structure in aliases_lookup list
+ * @alias: Alias property name
+ * @np: Pointer to device_node that the alias stands for
+ * @id: Index value from end of alias name
+ * @stem: Alias string without the index
+ *
+ * The structure represents one alias property of 'aliases' node as
+ * an entry in aliases_lookup list.
+ */
+struct dt_alias_prop {
+    struct list_head link;
+    const char *alias;
+    struct dt_device_node *np;
+    int id;
+    char stem[0];
+};
+
+static LIST_HEAD(aliases_lookup);
 
 /* Some device tree functions may be called both before and after the
    console is initialized. */
-static void (*dt_printk)(const char *fmt, ...) = early_printk;
+#define dt_printk(fmt, ...)                         \
+    do                                              \
+    {                                               \
+        if ( system_state == SYS_STATE_early_boot ) \
+            early_printk(fmt, ## __VA_ARGS__);      \
+        else                                        \
+            printk(fmt, ## __VA_ARGS__);            \
+    } while (0)
+
+#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1));
+
+// #define DEBUG_DT
+
+#ifdef DEBUG_DT
+# define dt_dprintk(fmt, args...) dt_printk(XENLOG_DEBUG fmt, ##args)
+#else
+# define dt_dprintk(fmt, args...) do {} while ( 0 )
+#endif
 
 bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
 {
@@ -263,7 +307,7 @@ static int dump_node(const void *fdt, int node, const char *name, int depth,
 
     if ( name[0] == '\0' )
         name = "/";
-    printk("%s%s:\n", prefix, name);
+    dt_printk("%s%s:\n", prefix, name);
 
     for ( prop = fdt_first_property_offset(fdt, node);
           prop >= 0;
@@ -273,7 +317,7 @@ static int dump_node(const void *fdt, int node, const char *name, int depth,
 
         p = fdt_get_property_by_offset(fdt, prop, NULL);
 
-        printk("%s  %s\n", prefix, fdt_string(fdt, fdt32_to_cpu(p->nameoff)));
+        dt_printk("%s  %s\n", prefix, fdt_string(fdt, fdt32_to_cpu(p->nameoff)));
     }
 
     return 0;
@@ -488,11 +532,412 @@ size_t __init device_tree_early_init(const void *fdt)
     device_tree_for_each_node((void *)fdt, early_scan_node, NULL);
     early_print_info();
 
-    dt_printk = printk;
-
     return fdt_totalsize(fdt);
 }
 
+static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
+                                       unsigned long align)
+{
+    void *res;
+
+    *mem = ALIGN(*mem, align);
+    res = (void *)*mem;
+    *mem += size;
+
+    return res;
+}
+
+/* Find a property with a given name for a given node and return it. */
+static const struct dt_property *
+dt_find_property(const struct dt_device_node *np,
+                 const char *name,
+                 u32 *lenp)
+{
+    const struct dt_property *pp;
+
+    if ( !np )
+        return NULL;
+
+    for ( pp = np->properties; pp; pp = pp->next )
+    {
+        if ( strcmp(pp->name, name) == 0 )
+        {
+            if ( lenp )
+                *lenp = pp->length;
+            break;
+        }
+    }
+
+    return pp;
+}
+
+const void *dt_get_property(const struct dt_device_node *np,
+                            const char *name, u32 *lenp)
+{
+    const struct dt_property *pp = dt_find_property(np, name, lenp);
+
+    return pp ? pp->value : NULL;
+}
+
+struct dt_device_node *dt_find_node_by_path(const char *path)
+{
+    struct dt_device_node *np;
+
+    for_each_device_node(dt_host, np)
+        if ( np->full_name && (dt_node_cmp(np->full_name, path) == 0) )
+            break;
+
+    return np;
+}
+
+/**
+ * unflatten_dt_node - Alloc and populate a device_node from the flat tree
+ * @fdt: The parent device tree blob
+ * @mem: Memory chunk to use for allocating device nodes and properties
+ * @p: pointer to node in flat tree
+ * @dad: Parent struct device_node
+ * @allnextpp: pointer to ->allnext from last allocated device_node
+ * @fpsize: Size of the node path up at the current depth.
+ */
+static unsigned long __init unflatten_dt_node(const void *fdt,
+                                              unsigned long mem,
+                                              unsigned long *p,
+                                              struct dt_device_node *dad,
+                                              struct dt_device_node ***allnextpp,
+                                              unsigned long fpsize)
+{
+    struct dt_device_node *np;
+    struct dt_property *pp, **prev_pp = NULL;
+    char *pathp;
+    u32 tag;
+    unsigned int l, allocl;
+    int has_name = 0;
+    int new_format = 0;
+
+    tag = be32_to_cpup((__be32 *)(*p));
+    if ( tag != FDT_BEGIN_NODE )
+    {
+        dt_printk(XENLOG_WARNING "Weird tag at start of node: %x\n", tag);
+        return mem;
+    }
+    *p += 4;
+    pathp = (char *)*p;
+    l = allocl = strlen(pathp) + 1;
+    *p = ALIGN(*p + l, 4);
+
+    /* version 0x10 has a more compact unit name here instead of the full
+     * path. we accumulate the full path size using "fpsize", we'll rebuild
+     * it later. We detect this because the first character of the name is
+     * not '/'.
+     */
+    if ( (*pathp) != '/' )
+    {
+        new_format = 1;
+        if ( fpsize == 0 )
+        {
+            /* root node: special case. fpsize accounts for path
+             * plus terminating zero. root node only has '/', so
+             * fpsize should be 2, but we want to avoid the first
+             * level nodes to have two '/' so we use fpsize 1 here
+             */
+            fpsize = 1;
+            allocl = 2;
+        }
+        else
+        {
+            /* account for '/' and path size minus terminal 0
+             * already in 'l'
+             */
+            fpsize += l;
+            allocl = fpsize;
+        }
+    }
+
+    np = unflatten_dt_alloc(&mem, sizeof(struct dt_device_node) + allocl,
+                            __alignof__(struct dt_device_node));
+    if ( allnextpp )
+    {
+        memset(np, 0, sizeof(*np));
+        np->full_name = ((char *)np) + sizeof(struct dt_device_node);
+        /* By default dom0 owns the device */
+        np->used_by = 0;
+        if ( new_format )
+        {
+            char *fn = np->full_name;
+            /* rebuild full path for new format */
+            if ( dad && dad->parent )
+            {
+                strlcpy(fn, dad->full_name, allocl);
+#ifdef DEBUG_DT
+                if ( (strlen(fn) + l + 1) != allocl )
+                {
+                    dt_dprintk("%s: p: %d, l: %d, a: %d\n",
+                               pathp, (int)strlen(fn),
+                               l, allocl);
+                }
+#endif
+                fn += strlen(fn);
+            }
+            *(fn++) = '/';
+            memcpy(fn, pathp, l);
+        }
+        else
+            memcpy(np->full_name, pathp, l);
+        prev_pp = &np->properties;
+        **allnextpp = np;
+        *allnextpp = &np->allnext;
+        if ( dad != NULL )
+        {
+            np->parent = dad;
+            /* we temporarily use the next field as `last_child'*/
+            if ( dad->next == NULL )
+                dad->child = np;
+            else
+                dad->next->sibling = np;
+            dad->next = np;
+        }
+    }
+    /* process properties */
+    while ( 1 )
+    {
+        u32 sz, noff;
+        const char *pname;
+
+        tag = be32_to_cpup((__be32 *)(*p));
+        if ( tag == FDT_NOP )
+        {
+            *p += 4;
+            continue;
+        }
+        if ( tag != FDT_PROP )
+            break;
+        *p += 4;
+        sz = be32_to_cpup((__be32 *)(*p));
+        noff = be32_to_cpup((__be32 *)((*p) + 4));
+        *p += 8;
+        if ( fdt_version(fdt) < 0x10 )
+            *p = ALIGN(*p, sz >= 8 ? 8 : 4);
+
+        pname = fdt_string(fdt, noff);
+        if ( pname == NULL )
+        {
+            dt_dprintk("Can't find property name in list!\n");
+            break;
+        }
+        if ( strcmp(pname, "name") == 0 )
+            has_name = 1;
+        l = strlen(pname) + 1;
+        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property),
+                                __alignof__(struct dt_property));
+        if ( allnextpp )
+        {
+            /* We accept flattened tree phandles either in
+             * ePAPR-style "phandle" properties, or the
+             * legacy "linux,phandle" properties.  If both
+             * appear and have different values, things
+             * will get weird.  Don't do that. */
+            if ( (strcmp(pname, "phandle") == 0) ||
+                 (strcmp(pname, "linux,phandle") == 0) )
+            {
+                if ( np->phandle == 0 )
+                    np->phandle = be32_to_cpup((__be32*)*p);
+            }
+            /* And we process the "ibm,phandle" property
+             * used in pSeries dynamic device tree
+             * stuff */
+            if ( strcmp(pname, "ibm,phandle") == 0 )
+                np->phandle = be32_to_cpup((__be32 *)*p);
+            pp->name = pname;
+            pp->length = sz;
+            pp->value = (void *)*p;
+            *prev_pp = pp;
+            prev_pp = &pp->next;
+        }
+        *p = ALIGN((*p) + sz, 4);
+    }
+    /* with version 0x10 we may not have the name property, recreate
+     * it here from the unit name if absent
+     */
+    if ( !has_name )
+    {
+        char *p1 = pathp, *ps = pathp, *pa = NULL;
+        int sz;
+
+        while ( *p1 )
+        {
+            if ( (*p1) == '@' )
+                pa = p1;
+            if ( (*p1) == '/' )
+                ps = p1 + 1;
+            p1++;
+        }
+        if ( pa < ps )
+            pa = p1;
+        sz = (pa - ps) + 1;
+        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property) + sz,
+                                __alignof__(struct dt_property));
+        if ( allnextpp )
+        {
+            pp->name = "name";
+            pp->length = sz;
+            pp->value = pp + 1;
+            *prev_pp = pp;
+            prev_pp = &pp->next;
+            memcpy(pp->value, ps, sz - 1);
+            ((char *)pp->value)[sz - 1] = 0;
+            dt_dprintk("fixed up name for %s -> %s\n", pathp,
+                       (char *)pp->value);
+        }
+    }
+    if ( allnextpp )
+    {
+        *prev_pp = NULL;
+        np->name = dt_get_property(np, "name", NULL);
+        np->type = dt_get_property(np, "device_type", NULL);
+
+        if ( !np->name )
+            np->name = "<NULL>";
+        if ( !np->type )
+            np->type = "<NULL>";
+    }
+    while ( tag == FDT_BEGIN_NODE || tag == FDT_NOP )
+    {
+        if ( tag == FDT_NOP )
+            *p += 4;
+        else
+            mem = unflatten_dt_node(fdt, mem, p, np, allnextpp, fpsize);
+        tag = be32_to_cpup((__be32 *)(*p));
+    }
+    if ( tag != FDT_END_NODE )
+    {
+        dt_printk(XENLOG_WARNING "Weird tag at end of node: %x\n", tag);
+        return mem;
+    }
+
+    *p += 4;
+    return mem;
+}
+
+/**
+ * __unflatten_device_tree - create tree of device_nodes from flat blob
+ *
+ * unflattens a device-tree, creating the
+ * tree of struct device_node. It also fills the "name" and "type"
+ * pointers of the nodes so the normal device-tree walking functions
+ * can be used.
+ * @fdt: The fdt to expand
+ * @mynodes: The device_node tree created by the call
+ */
+static void __init __unflatten_device_tree(const void *fdt,
+                                           struct dt_device_node **mynodes)
+{
+    unsigned long start, mem, size;
+    struct dt_device_node **allnextp = mynodes;
+
+    dt_dprintk(" -> unflatten_device_tree()\n");
+
+    dt_dprintk("Unflattening device tree:\n");
+    dt_dprintk("magic: %#08x\n", fdt_magic(fdt));
+    dt_dprintk("size: %#08x\n", fdt_totalsize(fdt));
+    dt_dprintk("version: %#08x\n", fdt_version(fdt));
+
+    /* First pass, scan for size */
+    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
+    size = unflatten_dt_node(fdt, 0, &start, NULL, NULL, 0);
+    size = (size | 3) + 1;
+
+    dt_dprintk("  size is %#lx allocating...\n", size);
+
+    /* Allocate memory for the expanded device tree */
+    mem = (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_device_node));
+
+    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
+
+    dt_dprintk("  unflattening %lx...\n", mem);
+
+    /* Second pass, do actual unflattening */
+    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
+    unflatten_dt_node(fdt, mem, &start, NULL, &allnextp, 0);
+    if ( be32_to_cpup((__be32 *)start) != FDT_END )
+        dt_printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n",
+                  *((u32 *)start));
+    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef )
+        dt_printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n",
+                  be32_to_cpu(((__be32 *)mem)[size / 4]));
+    *allnextp = NULL;
+
+    dt_dprintk(" <- unflatten_device_tree()\n");
+}
+
+static void dt_alias_add(struct dt_alias_prop *ap,
+                         struct dt_device_node *np,
+                         int id, const char *stem, int stem_len)
+{
+    ap->np = np;
+    ap->id = id;
+    strlcpy(ap->stem, stem, stem_len + 1);
+    list_add_tail(&ap->link, &aliases_lookup);
+    dt_dprintk("adding DT alias:%s: stem=%s id=%d node=%s\n",
+               ap->alias, ap->stem, ap->id, dt_node_full_name(np));
+}
+
+/**
+ * dt_alias_scan - Scan all properties of 'aliases' node
+ *
+ * The function scans all the properties of 'aliases' node and populate
+ * the the global lookup table with the properties.  It returns the
+ * number of alias_prop found, or error code in error case.
+ */
+static void __init dt_alias_scan(void)
+{
+    const struct dt_property *pp;
+    const struct dt_device_node *aliases;
+
+    aliases = dt_find_node_by_path("/aliases");
+    if ( !aliases )
+        return;
+
+    for_each_property_of_node( aliases, pp )
+    {
+        const char *start = pp->name;
+        const char *end = start + strlen(start);
+        struct dt_device_node *np;
+        struct dt_alias_prop *ap;
+        int id, len;
+
+        /* Skip those we do not want to proceed */
+        if ( !strcmp(pp->name, "name") ||
+             !strcmp(pp->name, "phandle") ||
+             !strcmp(pp->name, "linux,phandle") )
+            continue;
+
+        np = dt_find_node_by_path(pp->value);
+        if ( !np )
+            continue;
+
+        /* walk the alias backwards to extract the id and work out
+         * the 'stem' string */
+        while ( isdigit(*(end-1)) && end > start )
+            end--;
+        len = end - start;
+
+        id = simple_strtoll(end, NULL, 10);
+
+        /* Allocate an alias_prop with enough space for the stem */
+        ap = _xmalloc(sizeof(*ap) + len + 1, 4);
+        if ( !ap )
+            continue;
+        ap->alias = start;
+        dt_alias_add(ap, np, id, start, len);
+    }
+}
+
+void __init dt_unflatten_host_device_tree(void)
+{
+    __unflatten_device_tree(device_tree_flattened, &dt_host);
+    dt_alias_scan();
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 19bda98..015b808 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -10,6 +10,10 @@
 #ifndef __XEN_DEVICE_TREE_H__
 #define __XEN_DEVICE_TREE_H__
 
+#include <asm/byteorder.h>
+#include <public/xen.h>
+#include <xen/init.h>
+#include <xen/string.h>
 #include <xen/types.h>
 
 #define DEVICE_TREE_MAX_DEPTH 16
@@ -52,6 +56,49 @@ struct dt_early_info {
     struct dt_module_info modules;
 };
 
+typedef u32 dt_phandle;
+
+/**
+ * dt_property - describe a property for a device
+ * @name: name of the property
+ * @length: size of the value
+ * @value: pointer to data contained in the property
+ * @next: pointer to the next property of a specific node
+ */
+struct dt_property {
+    const char *name;
+    u32 length;
+    void *value;
+    struct dt_property *next;
+};
+
+/**
+ * dt_device_node - describe a node in the device tree
+ * @name: name of the node
+ * @type: type of the node (ie: memory, cpu, ...)
+ * @full_name: full name, it's composed of all the ascendant name separate by /
+ * @used_by: who owns the node? (ie: xen, dom0...)
+ * @properties: list of properties for the node
+ * @child: pointer to the first child
+ * @sibling: pointer to the next sibling
+ * @allnext: pointer to the next in list of all nodes
+ */
+struct dt_device_node {
+    const char *name;
+    const char *type;
+    dt_phandle phandle;
+    char *full_name;
+    domid_t used_by; /* By default it's used by dom0 */
+
+    struct dt_property *properties;
+    struct dt_device_node *parent;
+    struct dt_device_node *child;
+    struct dt_device_node *sibling;
+    struct dt_device_node *next; /* TODO: Remove it. Only use to know the last children */
+    struct dt_device_node *allnext;
+
+};
+
 typedef int (*device_tree_node_func)(const void *fdt,
                                      int node, const char *name, int depth,
                                      u32 address_cells, u32 size_cells,
@@ -77,4 +124,46 @@ int device_tree_for_each_node(const void *fdt,
 const char *device_tree_bootargs(const void *fdt);
 void device_tree_dump(const void *fdt);
 
+/**
+ * dt_unflatten_host_device_tree - Unflatten the host device tree
+ *
+ * Create a hierarchical device tree for the host DTB to be able
+ * to retrieve parents.
+ */
+void __init dt_unflatten_host_device_tree(void);
+
+/**
+ * Host device tree
+ * DO NOT modify it!
+ */
+extern struct dt_device_node *dt_host;
+
+#define dt_node_cmp(s1, s2) strcmp((s1), (s2))
+#define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
+
+#define for_each_property_of_node(dn, pp)                   \
+    for ( pp = dn->properties; pp != NULL; pp = pp->next )
+
+#define for_each_device_node(dt, dn)                         \
+    for ( dn = dt; dn != NULL; dn = dn->allnext )
+
+static inline const char *dt_node_full_name(const struct dt_device_node *np)
+{
+    return (np && np->full_name) ? np->full_name : "<no-node>";
+}
+
+/**
+ * Find a property with a given name for a given node
+ * and return the value.
+ */
+const void *dt_get_property(const struct dt_device_node *np,
+                            const char *name, u32 *lenp);
+
+/**
+ * dt_find_node_by_path - Find a node matching a full DT path
+ * @path: The full path to match
+ *
+ * Returns a node pointer.
+ */
+struct dt_device_node *dt_find_node_by_path(const char *path);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6Lr-0003dB-KY; Tue, 14 May 2013 03:56: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 1Uc6Lq-0003cm-2V
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:34 +0000
Received: from [193.109.254.147:13815] by server-6.bemta-14.messagelabs.com id
	B8/6C-00912-1F5B1915; Tue, 14 May 2013 03:56:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1368503788!9066819!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19273 invoked from network); 14 May 2013 03:56:30 -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;
	14 May 2013 03: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 1Uc6Lk-0003CQ-Ci
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Lk-0006RB-BE
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:28 +0000
Date: Tue, 14 May 2013 03:56:28 +0000
Message-Id: <E1Uc6Lk-0006RB-BE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Create a hierarchical device
	tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fb97eb614acfbcc812098bbbe5dde99271fe0a0d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 15:57:22 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Create a hierarchical device tree
    
    Add function to parse the device tree and create a hierarchical tree.
    
    This code is based on drivers/of/base.c in linux source.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/setup.c          |    1 +
 xen/common/device_tree.c      |  455 ++++++++++++++++++++++++++++++++++++++++-
 xen/include/xen/device_tree.h |   89 ++++++++
 3 files changed, 540 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index a667db4..81bc956 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -430,6 +430,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     setup_mm(fdt_paddr, fdt_size);
 
     vm_init();
+    dt_unflatten_host_device_tree();
 
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 7997f41..215feb1 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -2,6 +2,8 @@
  * Device Tree
  *
  * Copyright (C) 2012 Citrix Systems, Inc.
+ * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
+ * benh@kernel.crashing.org
  *
  * 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
@@ -19,14 +21,56 @@
 #include <xen/stdarg.h>
 #include <xen/string.h>
 #include <xen/cpumask.h>
+#include <xen/ctype.h>
+#include <xen/lib.h>
 #include <asm/early_printk.h>
 
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
+/* Host device tree */
+struct dt_device_node *dt_host;
+
+/**
+ * struct dt_alias_prop - Alias property in 'aliases' node
+ * @link: List node to link the structure in aliases_lookup list
+ * @alias: Alias property name
+ * @np: Pointer to device_node that the alias stands for
+ * @id: Index value from end of alias name
+ * @stem: Alias string without the index
+ *
+ * The structure represents one alias property of 'aliases' node as
+ * an entry in aliases_lookup list.
+ */
+struct dt_alias_prop {
+    struct list_head link;
+    const char *alias;
+    struct dt_device_node *np;
+    int id;
+    char stem[0];
+};
+
+static LIST_HEAD(aliases_lookup);
 
 /* Some device tree functions may be called both before and after the
    console is initialized. */
-static void (*dt_printk)(const char *fmt, ...) = early_printk;
+#define dt_printk(fmt, ...)                         \
+    do                                              \
+    {                                               \
+        if ( system_state == SYS_STATE_early_boot ) \
+            early_printk(fmt, ## __VA_ARGS__);      \
+        else                                        \
+            printk(fmt, ## __VA_ARGS__);            \
+    } while (0)
+
+#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1));
+
+// #define DEBUG_DT
+
+#ifdef DEBUG_DT
+# define dt_dprintk(fmt, args...) dt_printk(XENLOG_DEBUG fmt, ##args)
+#else
+# define dt_dprintk(fmt, args...) do {} while ( 0 )
+#endif
 
 bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
 {
@@ -263,7 +307,7 @@ static int dump_node(const void *fdt, int node, const char *name, int depth,
 
     if ( name[0] == '\0' )
         name = "/";
-    printk("%s%s:\n", prefix, name);
+    dt_printk("%s%s:\n", prefix, name);
 
     for ( prop = fdt_first_property_offset(fdt, node);
           prop >= 0;
@@ -273,7 +317,7 @@ static int dump_node(const void *fdt, int node, const char *name, int depth,
 
         p = fdt_get_property_by_offset(fdt, prop, NULL);
 
-        printk("%s  %s\n", prefix, fdt_string(fdt, fdt32_to_cpu(p->nameoff)));
+        dt_printk("%s  %s\n", prefix, fdt_string(fdt, fdt32_to_cpu(p->nameoff)));
     }
 
     return 0;
@@ -488,11 +532,412 @@ size_t __init device_tree_early_init(const void *fdt)
     device_tree_for_each_node((void *)fdt, early_scan_node, NULL);
     early_print_info();
 
-    dt_printk = printk;
-
     return fdt_totalsize(fdt);
 }
 
+static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
+                                       unsigned long align)
+{
+    void *res;
+
+    *mem = ALIGN(*mem, align);
+    res = (void *)*mem;
+    *mem += size;
+
+    return res;
+}
+
+/* Find a property with a given name for a given node and return it. */
+static const struct dt_property *
+dt_find_property(const struct dt_device_node *np,
+                 const char *name,
+                 u32 *lenp)
+{
+    const struct dt_property *pp;
+
+    if ( !np )
+        return NULL;
+
+    for ( pp = np->properties; pp; pp = pp->next )
+    {
+        if ( strcmp(pp->name, name) == 0 )
+        {
+            if ( lenp )
+                *lenp = pp->length;
+            break;
+        }
+    }
+
+    return pp;
+}
+
+const void *dt_get_property(const struct dt_device_node *np,
+                            const char *name, u32 *lenp)
+{
+    const struct dt_property *pp = dt_find_property(np, name, lenp);
+
+    return pp ? pp->value : NULL;
+}
+
+struct dt_device_node *dt_find_node_by_path(const char *path)
+{
+    struct dt_device_node *np;
+
+    for_each_device_node(dt_host, np)
+        if ( np->full_name && (dt_node_cmp(np->full_name, path) == 0) )
+            break;
+
+    return np;
+}
+
+/**
+ * unflatten_dt_node - Alloc and populate a device_node from the flat tree
+ * @fdt: The parent device tree blob
+ * @mem: Memory chunk to use for allocating device nodes and properties
+ * @p: pointer to node in flat tree
+ * @dad: Parent struct device_node
+ * @allnextpp: pointer to ->allnext from last allocated device_node
+ * @fpsize: Size of the node path up at the current depth.
+ */
+static unsigned long __init unflatten_dt_node(const void *fdt,
+                                              unsigned long mem,
+                                              unsigned long *p,
+                                              struct dt_device_node *dad,
+                                              struct dt_device_node ***allnextpp,
+                                              unsigned long fpsize)
+{
+    struct dt_device_node *np;
+    struct dt_property *pp, **prev_pp = NULL;
+    char *pathp;
+    u32 tag;
+    unsigned int l, allocl;
+    int has_name = 0;
+    int new_format = 0;
+
+    tag = be32_to_cpup((__be32 *)(*p));
+    if ( tag != FDT_BEGIN_NODE )
+    {
+        dt_printk(XENLOG_WARNING "Weird tag at start of node: %x\n", tag);
+        return mem;
+    }
+    *p += 4;
+    pathp = (char *)*p;
+    l = allocl = strlen(pathp) + 1;
+    *p = ALIGN(*p + l, 4);
+
+    /* version 0x10 has a more compact unit name here instead of the full
+     * path. we accumulate the full path size using "fpsize", we'll rebuild
+     * it later. We detect this because the first character of the name is
+     * not '/'.
+     */
+    if ( (*pathp) != '/' )
+    {
+        new_format = 1;
+        if ( fpsize == 0 )
+        {
+            /* root node: special case. fpsize accounts for path
+             * plus terminating zero. root node only has '/', so
+             * fpsize should be 2, but we want to avoid the first
+             * level nodes to have two '/' so we use fpsize 1 here
+             */
+            fpsize = 1;
+            allocl = 2;
+        }
+        else
+        {
+            /* account for '/' and path size minus terminal 0
+             * already in 'l'
+             */
+            fpsize += l;
+            allocl = fpsize;
+        }
+    }
+
+    np = unflatten_dt_alloc(&mem, sizeof(struct dt_device_node) + allocl,
+                            __alignof__(struct dt_device_node));
+    if ( allnextpp )
+    {
+        memset(np, 0, sizeof(*np));
+        np->full_name = ((char *)np) + sizeof(struct dt_device_node);
+        /* By default dom0 owns the device */
+        np->used_by = 0;
+        if ( new_format )
+        {
+            char *fn = np->full_name;
+            /* rebuild full path for new format */
+            if ( dad && dad->parent )
+            {
+                strlcpy(fn, dad->full_name, allocl);
+#ifdef DEBUG_DT
+                if ( (strlen(fn) + l + 1) != allocl )
+                {
+                    dt_dprintk("%s: p: %d, l: %d, a: %d\n",
+                               pathp, (int)strlen(fn),
+                               l, allocl);
+                }
+#endif
+                fn += strlen(fn);
+            }
+            *(fn++) = '/';
+            memcpy(fn, pathp, l);
+        }
+        else
+            memcpy(np->full_name, pathp, l);
+        prev_pp = &np->properties;
+        **allnextpp = np;
+        *allnextpp = &np->allnext;
+        if ( dad != NULL )
+        {
+            np->parent = dad;
+            /* we temporarily use the next field as `last_child'*/
+            if ( dad->next == NULL )
+                dad->child = np;
+            else
+                dad->next->sibling = np;
+            dad->next = np;
+        }
+    }
+    /* process properties */
+    while ( 1 )
+    {
+        u32 sz, noff;
+        const char *pname;
+
+        tag = be32_to_cpup((__be32 *)(*p));
+        if ( tag == FDT_NOP )
+        {
+            *p += 4;
+            continue;
+        }
+        if ( tag != FDT_PROP )
+            break;
+        *p += 4;
+        sz = be32_to_cpup((__be32 *)(*p));
+        noff = be32_to_cpup((__be32 *)((*p) + 4));
+        *p += 8;
+        if ( fdt_version(fdt) < 0x10 )
+            *p = ALIGN(*p, sz >= 8 ? 8 : 4);
+
+        pname = fdt_string(fdt, noff);
+        if ( pname == NULL )
+        {
+            dt_dprintk("Can't find property name in list!\n");
+            break;
+        }
+        if ( strcmp(pname, "name") == 0 )
+            has_name = 1;
+        l = strlen(pname) + 1;
+        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property),
+                                __alignof__(struct dt_property));
+        if ( allnextpp )
+        {
+            /* We accept flattened tree phandles either in
+             * ePAPR-style "phandle" properties, or the
+             * legacy "linux,phandle" properties.  If both
+             * appear and have different values, things
+             * will get weird.  Don't do that. */
+            if ( (strcmp(pname, "phandle") == 0) ||
+                 (strcmp(pname, "linux,phandle") == 0) )
+            {
+                if ( np->phandle == 0 )
+                    np->phandle = be32_to_cpup((__be32*)*p);
+            }
+            /* And we process the "ibm,phandle" property
+             * used in pSeries dynamic device tree
+             * stuff */
+            if ( strcmp(pname, "ibm,phandle") == 0 )
+                np->phandle = be32_to_cpup((__be32 *)*p);
+            pp->name = pname;
+            pp->length = sz;
+            pp->value = (void *)*p;
+            *prev_pp = pp;
+            prev_pp = &pp->next;
+        }
+        *p = ALIGN((*p) + sz, 4);
+    }
+    /* with version 0x10 we may not have the name property, recreate
+     * it here from the unit name if absent
+     */
+    if ( !has_name )
+    {
+        char *p1 = pathp, *ps = pathp, *pa = NULL;
+        int sz;
+
+        while ( *p1 )
+        {
+            if ( (*p1) == '@' )
+                pa = p1;
+            if ( (*p1) == '/' )
+                ps = p1 + 1;
+            p1++;
+        }
+        if ( pa < ps )
+            pa = p1;
+        sz = (pa - ps) + 1;
+        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property) + sz,
+                                __alignof__(struct dt_property));
+        if ( allnextpp )
+        {
+            pp->name = "name";
+            pp->length = sz;
+            pp->value = pp + 1;
+            *prev_pp = pp;
+            prev_pp = &pp->next;
+            memcpy(pp->value, ps, sz - 1);
+            ((char *)pp->value)[sz - 1] = 0;
+            dt_dprintk("fixed up name for %s -> %s\n", pathp,
+                       (char *)pp->value);
+        }
+    }
+    if ( allnextpp )
+    {
+        *prev_pp = NULL;
+        np->name = dt_get_property(np, "name", NULL);
+        np->type = dt_get_property(np, "device_type", NULL);
+
+        if ( !np->name )
+            np->name = "<NULL>";
+        if ( !np->type )
+            np->type = "<NULL>";
+    }
+    while ( tag == FDT_BEGIN_NODE || tag == FDT_NOP )
+    {
+        if ( tag == FDT_NOP )
+            *p += 4;
+        else
+            mem = unflatten_dt_node(fdt, mem, p, np, allnextpp, fpsize);
+        tag = be32_to_cpup((__be32 *)(*p));
+    }
+    if ( tag != FDT_END_NODE )
+    {
+        dt_printk(XENLOG_WARNING "Weird tag at end of node: %x\n", tag);
+        return mem;
+    }
+
+    *p += 4;
+    return mem;
+}
+
+/**
+ * __unflatten_device_tree - create tree of device_nodes from flat blob
+ *
+ * unflattens a device-tree, creating the
+ * tree of struct device_node. It also fills the "name" and "type"
+ * pointers of the nodes so the normal device-tree walking functions
+ * can be used.
+ * @fdt: The fdt to expand
+ * @mynodes: The device_node tree created by the call
+ */
+static void __init __unflatten_device_tree(const void *fdt,
+                                           struct dt_device_node **mynodes)
+{
+    unsigned long start, mem, size;
+    struct dt_device_node **allnextp = mynodes;
+
+    dt_dprintk(" -> unflatten_device_tree()\n");
+
+    dt_dprintk("Unflattening device tree:\n");
+    dt_dprintk("magic: %#08x\n", fdt_magic(fdt));
+    dt_dprintk("size: %#08x\n", fdt_totalsize(fdt));
+    dt_dprintk("version: %#08x\n", fdt_version(fdt));
+
+    /* First pass, scan for size */
+    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
+    size = unflatten_dt_node(fdt, 0, &start, NULL, NULL, 0);
+    size = (size | 3) + 1;
+
+    dt_dprintk("  size is %#lx allocating...\n", size);
+
+    /* Allocate memory for the expanded device tree */
+    mem = (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_device_node));
+
+    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
+
+    dt_dprintk("  unflattening %lx...\n", mem);
+
+    /* Second pass, do actual unflattening */
+    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
+    unflatten_dt_node(fdt, mem, &start, NULL, &allnextp, 0);
+    if ( be32_to_cpup((__be32 *)start) != FDT_END )
+        dt_printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n",
+                  *((u32 *)start));
+    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef )
+        dt_printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n",
+                  be32_to_cpu(((__be32 *)mem)[size / 4]));
+    *allnextp = NULL;
+
+    dt_dprintk(" <- unflatten_device_tree()\n");
+}
+
+static void dt_alias_add(struct dt_alias_prop *ap,
+                         struct dt_device_node *np,
+                         int id, const char *stem, int stem_len)
+{
+    ap->np = np;
+    ap->id = id;
+    strlcpy(ap->stem, stem, stem_len + 1);
+    list_add_tail(&ap->link, &aliases_lookup);
+    dt_dprintk("adding DT alias:%s: stem=%s id=%d node=%s\n",
+               ap->alias, ap->stem, ap->id, dt_node_full_name(np));
+}
+
+/**
+ * dt_alias_scan - Scan all properties of 'aliases' node
+ *
+ * The function scans all the properties of 'aliases' node and populate
+ * the the global lookup table with the properties.  It returns the
+ * number of alias_prop found, or error code in error case.
+ */
+static void __init dt_alias_scan(void)
+{
+    const struct dt_property *pp;
+    const struct dt_device_node *aliases;
+
+    aliases = dt_find_node_by_path("/aliases");
+    if ( !aliases )
+        return;
+
+    for_each_property_of_node( aliases, pp )
+    {
+        const char *start = pp->name;
+        const char *end = start + strlen(start);
+        struct dt_device_node *np;
+        struct dt_alias_prop *ap;
+        int id, len;
+
+        /* Skip those we do not want to proceed */
+        if ( !strcmp(pp->name, "name") ||
+             !strcmp(pp->name, "phandle") ||
+             !strcmp(pp->name, "linux,phandle") )
+            continue;
+
+        np = dt_find_node_by_path(pp->value);
+        if ( !np )
+            continue;
+
+        /* walk the alias backwards to extract the id and work out
+         * the 'stem' string */
+        while ( isdigit(*(end-1)) && end > start )
+            end--;
+        len = end - start;
+
+        id = simple_strtoll(end, NULL, 10);
+
+        /* Allocate an alias_prop with enough space for the stem */
+        ap = _xmalloc(sizeof(*ap) + len + 1, 4);
+        if ( !ap )
+            continue;
+        ap->alias = start;
+        dt_alias_add(ap, np, id, start, len);
+    }
+}
+
+void __init dt_unflatten_host_device_tree(void)
+{
+    __unflatten_device_tree(device_tree_flattened, &dt_host);
+    dt_alias_scan();
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 19bda98..015b808 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -10,6 +10,10 @@
 #ifndef __XEN_DEVICE_TREE_H__
 #define __XEN_DEVICE_TREE_H__
 
+#include <asm/byteorder.h>
+#include <public/xen.h>
+#include <xen/init.h>
+#include <xen/string.h>
 #include <xen/types.h>
 
 #define DEVICE_TREE_MAX_DEPTH 16
@@ -52,6 +56,49 @@ struct dt_early_info {
     struct dt_module_info modules;
 };
 
+typedef u32 dt_phandle;
+
+/**
+ * dt_property - describe a property for a device
+ * @name: name of the property
+ * @length: size of the value
+ * @value: pointer to data contained in the property
+ * @next: pointer to the next property of a specific node
+ */
+struct dt_property {
+    const char *name;
+    u32 length;
+    void *value;
+    struct dt_property *next;
+};
+
+/**
+ * dt_device_node - describe a node in the device tree
+ * @name: name of the node
+ * @type: type of the node (ie: memory, cpu, ...)
+ * @full_name: full name, it's composed of all the ascendant name separate by /
+ * @used_by: who owns the node? (ie: xen, dom0...)
+ * @properties: list of properties for the node
+ * @child: pointer to the first child
+ * @sibling: pointer to the next sibling
+ * @allnext: pointer to the next in list of all nodes
+ */
+struct dt_device_node {
+    const char *name;
+    const char *type;
+    dt_phandle phandle;
+    char *full_name;
+    domid_t used_by; /* By default it's used by dom0 */
+
+    struct dt_property *properties;
+    struct dt_device_node *parent;
+    struct dt_device_node *child;
+    struct dt_device_node *sibling;
+    struct dt_device_node *next; /* TODO: Remove it. Only use to know the last children */
+    struct dt_device_node *allnext;
+
+};
+
 typedef int (*device_tree_node_func)(const void *fdt,
                                      int node, const char *name, int depth,
                                      u32 address_cells, u32 size_cells,
@@ -77,4 +124,46 @@ int device_tree_for_each_node(const void *fdt,
 const char *device_tree_bootargs(const void *fdt);
 void device_tree_dump(const void *fdt);
 
+/**
+ * dt_unflatten_host_device_tree - Unflatten the host device tree
+ *
+ * Create a hierarchical device tree for the host DTB to be able
+ * to retrieve parents.
+ */
+void __init dt_unflatten_host_device_tree(void);
+
+/**
+ * Host device tree
+ * DO NOT modify it!
+ */
+extern struct dt_device_node *dt_host;
+
+#define dt_node_cmp(s1, s2) strcmp((s1), (s2))
+#define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
+
+#define for_each_property_of_node(dn, pp)                   \
+    for ( pp = dn->properties; pp != NULL; pp = pp->next )
+
+#define for_each_device_node(dt, dn)                         \
+    for ( dn = dt; dn != NULL; dn = dn->allnext )
+
+static inline const char *dt_node_full_name(const struct dt_device_node *np)
+{
+    return (np && np->full_name) ? np->full_name : "<no-node>";
+}
+
+/**
+ * Find a property with a given name for a given node
+ * and return the value.
+ */
+const void *dt_get_property(const struct dt_device_node *np,
+                            const char *name, u32 *lenp);
+
+/**
+ * dt_find_node_by_path - Find a node matching a full DT path
+ * @path: The full path to match
+ *
+ * Returns a node pointer.
+ */
+struct dt_device_node *dt_find_node_by_path(const char *path);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6M0-0003f1-NS; Tue, 14 May 2013 03:56:44 +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 1Uc6Ly-0003eX-Lo
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:43 +0000
Received: from [193.109.254.147:25199] by server-11.bemta-14.messagelabs.com
	id A9/F6-09099-9F5B1915; Tue, 14 May 2013 03:56:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1368503798!4671525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12468 invoked from network); 14 May 2013 03:56:39 -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;
	14 May 2013 03:56: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 1Uc6Lu-0003CW-J1
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Lu-0006Re-Gs
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:38 +0000
Date: Tue, 14 May 2013 03:56:38 +0000
Message-Id: <E1Uc6Lu-0006Re-Gs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers to use the device
	tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dbd1243248298014f47f88ad43f592133f4fc82f
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:09:25 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers to use the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c      |  162 ++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/device_tree.h |  155 +++++++++++++++++++++++++++++++++++----
 2 files changed, 283 insertions(+), 34 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 215feb1..92f2ac5 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -72,7 +72,8 @@ static LIST_HEAD(aliases_lookup);
 # define dt_dprintk(fmt, args...) do {} while ( 0 )
 #endif
 
-bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
+bool_t __init device_tree_node_matches(const void *fdt, int node,
+                                       const char *match)
 {
     const char *name;
     size_t match_len;
@@ -86,7 +87,8 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
         && (name[match_len] == '@' || name[match_len] == '\0');
 }
 
-bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
+bool_t __init device_tree_type_matches(const void *fdt, int node,
+                                       const char *match)
 {
     const void *prop;
 
@@ -94,20 +96,24 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
     if ( prop == NULL )
         return 0;
 
-    return !strcmp(prop, match);
+    return !dt_node_cmp(prop, match);
 }
 
-bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+bool_t __init device_tree_node_compatible(const void *fdt, int node,
+                                          const char *match)
 {
     int len, l;
+    int mlen;
     const void *prop;
 
+    mlen = strlen(match);
+
     prop = fdt_getprop(fdt, node, "compatible", &len);
     if ( prop == NULL )
         return 0;
 
     while ( len > 0 ) {
-        if ( !strcmp(prop, match) )
+        if ( !dt_compat_cmp(prop, match, mlen) )
             return 1;
         l = strlen(prop) + 1;
         prop += l;
@@ -117,7 +123,7 @@ bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
     return 0;
 }
 
-static int device_tree_nr_reg_ranges(const struct fdt_property *prop,
+static __init int device_tree_nr_reg_ranges(const struct fdt_property *prop,
         u32 address_cells, u32 size_cells)
 {
     u32 reg_cells = address_cells + size_cells;
@@ -138,14 +144,14 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
     }
 }
 
-void device_tree_get_reg(const u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 *start, u64 *size)
+void __init device_tree_get_reg(const u32 **cell, u32 address_cells,
+                                u32 size_cells, u64 *start, u64 *size)
 {
     get_val(cell, address_cells, start);
     get_val(cell, size_cells, size);
 }
 
-static void set_val(u32 **cell, u32 cells, u64 val)
+static void __init set_val(u32 **cell, u32 cells, u64 val)
 {
     u32 c = cells;
 
@@ -157,15 +163,15 @@ static void set_val(u32 **cell, u32 cells, u64 val)
     (*cell) += cells;
 }
 
-void device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 start, u64 size)
+void __init device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
+                                u64 start, u64 size)
 {
     set_val(cell, address_cells, start);
     set_val(cell, size_cells, size);
 }
 
-u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name,
-                        u32 dflt)
+u32 __init device_tree_get_u32(const void *fdt, int node, const char *prop_name,
+                               u32 dflt)
 {
     const struct fdt_property *prop;
 
@@ -187,8 +193,8 @@ u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name,
  * Returns 0 if all nodes were iterated over successfully.  If @func
  * returns a value different from 0, that value is returned immediately.
  */
-int device_tree_for_each_node(const void *fdt,
-                              device_tree_node_func func, void *data)
+int __init device_tree_for_each_node(const void *fdt,
+                                     device_tree_node_func func, void *data)
 {
     int node;
     int depth;
@@ -254,8 +260,8 @@ static int _find_compatible_node(const void *fdt,
     return 0;
 }
 
-int find_compatible_node(const char *compatible, int *node, int *depth,
-                u32 *address_cells, u32 *size_cells)
+int __init find_compatible_node(const char *compatible, int *node, int *depth,
+                                u32 *address_cells, u32 *size_cells)
 {
     int ret;
     struct find_compat c;
@@ -327,7 +333,7 @@ static int dump_node(const void *fdt, int node, const char *name, int depth,
  * device_tree_dump - print a text representation of a device tree
  * @fdt: flat device tree to print
  */
-void device_tree_dump(const void *fdt)
+void __init device_tree_dump(const void *fdt)
 {
     device_tree_for_each_node(fdt, dump_node, NULL);
 }
@@ -579,6 +585,54 @@ const void *dt_get_property(const struct dt_device_node *np,
     return pp ? pp->value : NULL;
 }
 
+bool_t dt_device_is_compatible(const struct dt_device_node *device,
+                               const char *compat)
+{
+    const char* cp;
+    u32 cplen, l;
+
+    cp = dt_get_property(device, "compatible", &cplen);
+    if ( cp == NULL )
+        return 0;
+    while ( cplen > 0 )
+    {
+        if ( dt_compat_cmp(cp, compat, strlen(compat)) == 0 )
+            return 1;
+        l = strlen(cp) + 1;
+        cp += l;
+        cplen -= l;
+    }
+
+    return 0;
+}
+
+bool_t dt_machine_is_compatible(const char *compat)
+{
+    const struct dt_device_node *root;
+    bool_t rc = 0;
+
+    root = dt_find_node_by_path("/");
+    if ( root )
+    {
+        rc = dt_device_is_compatible(root, compat);
+    }
+    return rc;
+}
+
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
+                                            const char *name)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    for_each_device_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            break;
+
+    return np;
+}
+
 struct dt_device_node *dt_find_node_by_path(const char *path)
 {
     struct dt_device_node *np;
@@ -590,6 +644,78 @@ struct dt_device_node *dt_find_node_by_path(const char *path)
     return np;
 }
 
+struct dt_device_node *dt_find_node_by_alias(const char *alias)
+{
+    const struct dt_alias_prop *app;
+
+    list_for_each_entry( app, &aliases_lookup, link )
+    {
+        if ( !strcmp(app->alias, alias) )
+            return app->np;
+    }
+
+    return NULL;
+}
+
+const struct dt_device_node *dt_get_parent(const struct dt_device_node *node)
+{
+    if ( !node )
+        return NULL;
+
+    return node->parent;
+}
+
+struct dt_device_node *
+dt_find_compatible_node(struct dt_device_node *from,
+                        const char *type,
+                        const char *compatible)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    for_each_device_node(dt, np)
+    {
+        if ( type
+             && !(np->type && (dt_node_cmp(np->type, type) == 0)) )
+            continue;
+        if ( dt_device_is_compatible(np, compatible) )
+            break;
+    }
+
+    return np;
+}
+
+int dt_n_addr_cells(const struct dt_device_node *np)
+{
+    const __be32 *ip;
+
+    do {
+        if ( np->parent )
+            np = np->parent;
+        ip = dt_get_property(np, "#address-cells", NULL);
+        if ( ip )
+            return be32_to_cpup(ip);
+    } while ( np->parent );
+    /* No #address-cells property for the root node */
+    return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
+}
+
+int dt_n_size_cells(const struct dt_device_node *np)
+{
+    const __be32 *ip;
+
+    do {
+        if ( np->parent )
+            np = np->parent;
+        ip = dt_get_property(np, "#size-cells", NULL);
+        if ( ip )
+            return be32_to_cpup(ip);
+    } while ( np->parent );
+    /* No #address-cells property for the root node */
+    return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
+}
+
 /**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 015b808..7a6adc7 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -107,22 +107,25 @@ typedef int (*device_tree_node_func)(const void *fdt,
 extern struct dt_early_info early_info;
 extern void *device_tree_flattened;
 
-size_t device_tree_early_init(const void *fdt);
-
-void device_tree_get_reg(const u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 *start, u64 *size);
-void device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 start, u64 size);
-u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name,
-			u32 dflt);
-bool_t device_tree_node_matches(const void *fdt, int node, const char *match);
-bool_t device_tree_node_compatible(const void *fdt, int node, const char *match);
-int find_compatible_node(const char *compatible, int *node, int *depth,
-                u32 *address_cells, u32 *size_cells);
-int device_tree_for_each_node(const void *fdt,
-                              device_tree_node_func func, void *data);
-const char *device_tree_bootargs(const void *fdt);
-void device_tree_dump(const void *fdt);
+size_t __init device_tree_early_init(const void *fdt);
+
+void __init device_tree_get_reg(const u32 **cell, u32 address_cells,
+                                u32 size_cells,
+                                u64 *start, u64 *size);
+void __init device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
+                                u64 start, u64 size);
+u32 __init device_tree_get_u32(const void *fdt, int node,
+                               const char *prop_name, u32 dflt);
+bool_t __init device_tree_node_matches(const void *fdt, int node,
+                                       const char *match);
+bool_t __init device_tree_node_compatible(const void *fdt, int node,
+                                          const char *match);
+int __init find_compatible_node(const char *compatible, int *node, int *depth,
+                                u32 *address_cells, u32 *size_cells);
+int __init device_tree_for_each_node(const void *fdt,
+                                     device_tree_node_func func, void *data);
+const char __init *device_tree_bootargs(const void *fdt);
+void __init device_tree_dump(const void *fdt);
 
 /**
  * dt_unflatten_host_device_tree - Unflatten the host device tree
@@ -141,17 +144,72 @@ extern struct dt_device_node *dt_host;
 #define dt_node_cmp(s1, s2) strcmp((s1), (s2))
 #define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
 
+/* Default #address and #size cells */
+#define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define DT_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
 #define for_each_property_of_node(dn, pp)                   \
     for ( pp = dn->properties; pp != NULL; pp = pp->next )
 
 #define for_each_device_node(dt, dn)                         \
     for ( dn = dt; dn != NULL; dn = dn->allnext )
 
+/* Helper to read a big number; size is in cells (not bytes) */
+static inline u64 dt_read_number(const __be32 *cell, int size)
+{
+    u64 r = 0;
+
+    while ( size-- )
+        r = (r << 32) | be32_to_cpu(*(cell++));
+    return r;
+}
+
 static inline const char *dt_node_full_name(const struct dt_device_node *np)
 {
     return (np && np->full_name) ? np->full_name : "<no-node>";
 }
 
+static inline const char *dt_node_name(const struct dt_device_node *np)
+{
+    return (np && np->name) ? np->name : "<no-node>";
+}
+
+static inline bool_t
+dt_device_type_is_equal(const struct dt_device_node *device,
+                        const char *type)
+{
+    return !dt_node_cmp(device->type, type);
+}
+
+static inline void dt_device_set_used_by(struct dt_device_node *device,
+                                         domid_t used_by)
+{
+    /* TODO: children must inherit to the used_by thing */
+    device->used_by = used_by;
+}
+
+static inline domid_t dt_device_used_by(const struct dt_device_node *device)
+{
+    return device->used_by;
+}
+
+/**
+ * dt_find_compatible_node - Find a node based on type and one of the
+ *                           tokens in its "compatible" property
+ * @from: The node to start searching from or NULL, the node
+ *          you pass will not be searched, only the next one
+ *          will; typically, you pass what the previous call
+ *          returned.
+ * @type: The type string to match "device_type" or NULL to ignore
+ * @compatible: The string to match to one of the tokens in the device
+ *          "compatible" list.
+ *
+ * Returns a node pointer.
+ */
+struct dt_device_node *dt_find_compatible_node(struct dt_device_node *from,
+                                               const char *type,
+                                               const char *compatible);
+
 /**
  * Find a property with a given name for a given node
  * and return the value.
@@ -160,10 +218,75 @@ const void *dt_get_property(const struct dt_device_node *np,
                             const char *name, u32 *lenp);
 
 /**
+ * Checks if the given "compat" string matches one of the strings in
+ * the device's "compatible" property
+ */
+bool_t dt_device_is_compatible(const struct dt_device_node *device,
+                               const char *compat);
+
+/**
+ * dt_machine_is_compatible - Test root of device tree for a given compatible value
+ * @compat: compatible string to look for in root node's compatible property.
+ *
+ * Returns true if the root node has the given value in its
+ * compatible property.
+ */
+bool_t dt_machine_is_compatible(const char *compat);
+
+/**
+ * dt_find_node_by_name - Find a node by its "name" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ *  will; typically, you pass what the previous call
+ *  returned. of_node_put() will be called on it
+ * @name: The name string to match against
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
+                                            const char *name);
+
+/**
+ * df_find_node_by_alias - Find a node matching an alias
+ * @alias: The alias to match
+ *
+ * Returns a node pointer.
+ */
+struct dt_device_node *dt_find_node_by_alias(const char *alias);
+
+/**
  * dt_find_node_by_path - Find a node matching a full DT path
  * @path: The full path to match
  *
  * Returns a node pointer.
  */
 struct dt_device_node *dt_find_node_by_path(const char *path);
+
+/**
+ * dt_get_parent - Get a node's parent if any
+ * @node: Node to get parent
+ *
+ * Returns a node pointer.
+ */
+const struct dt_device_node *dt_get_parent(const struct dt_device_node *node);
+
+/**
+ * dt_n_size_cells - Helper to retrieve the number of cell for the size
+ * @np: node to get the value
+ *
+ * This function retrieves for a give device-tree node the number of
+ * cell for the size field.
+ */
+int dt_n_size_cells(const struct dt_device_node *np);
+
+/**
+ * dt_n_addr_cells - Helper to retrieve the number of cell for the address
+ * @np: node to get the value
+ *
+ * This function retrieves for a give device-tree node the number of
+ * cell for the address field.
+ */
+int dt_n_addr_cells(const struct dt_device_node *np);
+
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6M0-0003f1-NS; Tue, 14 May 2013 03:56:44 +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 1Uc6Ly-0003eX-Lo
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:43 +0000
Received: from [193.109.254.147:25199] by server-11.bemta-14.messagelabs.com
	id A9/F6-09099-9F5B1915; Tue, 14 May 2013 03:56:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1368503798!4671525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12468 invoked from network); 14 May 2013 03:56:39 -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;
	14 May 2013 03:56: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 1Uc6Lu-0003CW-J1
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Lu-0006Re-Gs
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:38 +0000
Date: Tue, 14 May 2013 03:56:38 +0000
Message-Id: <E1Uc6Lu-0006Re-Gs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers to use the device
	tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 dbd1243248298014f47f88ad43f592133f4fc82f
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:09:25 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers to use the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c      |  162 ++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/device_tree.h |  155 +++++++++++++++++++++++++++++++++++----
 2 files changed, 283 insertions(+), 34 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 215feb1..92f2ac5 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -72,7 +72,8 @@ static LIST_HEAD(aliases_lookup);
 # define dt_dprintk(fmt, args...) do {} while ( 0 )
 #endif
 
-bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
+bool_t __init device_tree_node_matches(const void *fdt, int node,
+                                       const char *match)
 {
     const char *name;
     size_t match_len;
@@ -86,7 +87,8 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match)
         && (name[match_len] == '@' || name[match_len] == '\0');
 }
 
-bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
+bool_t __init device_tree_type_matches(const void *fdt, int node,
+                                       const char *match)
 {
     const void *prop;
 
@@ -94,20 +96,24 @@ bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
     if ( prop == NULL )
         return 0;
 
-    return !strcmp(prop, match);
+    return !dt_node_cmp(prop, match);
 }
 
-bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+bool_t __init device_tree_node_compatible(const void *fdt, int node,
+                                          const char *match)
 {
     int len, l;
+    int mlen;
     const void *prop;
 
+    mlen = strlen(match);
+
     prop = fdt_getprop(fdt, node, "compatible", &len);
     if ( prop == NULL )
         return 0;
 
     while ( len > 0 ) {
-        if ( !strcmp(prop, match) )
+        if ( !dt_compat_cmp(prop, match, mlen) )
             return 1;
         l = strlen(prop) + 1;
         prop += l;
@@ -117,7 +123,7 @@ bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
     return 0;
 }
 
-static int device_tree_nr_reg_ranges(const struct fdt_property *prop,
+static __init int device_tree_nr_reg_ranges(const struct fdt_property *prop,
         u32 address_cells, u32 size_cells)
 {
     u32 reg_cells = address_cells + size_cells;
@@ -138,14 +144,14 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val)
     }
 }
 
-void device_tree_get_reg(const u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 *start, u64 *size)
+void __init device_tree_get_reg(const u32 **cell, u32 address_cells,
+                                u32 size_cells, u64 *start, u64 *size)
 {
     get_val(cell, address_cells, start);
     get_val(cell, size_cells, size);
 }
 
-static void set_val(u32 **cell, u32 cells, u64 val)
+static void __init set_val(u32 **cell, u32 cells, u64 val)
 {
     u32 c = cells;
 
@@ -157,15 +163,15 @@ static void set_val(u32 **cell, u32 cells, u64 val)
     (*cell) += cells;
 }
 
-void device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 start, u64 size)
+void __init device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
+                                u64 start, u64 size)
 {
     set_val(cell, address_cells, start);
     set_val(cell, size_cells, size);
 }
 
-u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name,
-                        u32 dflt)
+u32 __init device_tree_get_u32(const void *fdt, int node, const char *prop_name,
+                               u32 dflt)
 {
     const struct fdt_property *prop;
 
@@ -187,8 +193,8 @@ u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name,
  * Returns 0 if all nodes were iterated over successfully.  If @func
  * returns a value different from 0, that value is returned immediately.
  */
-int device_tree_for_each_node(const void *fdt,
-                              device_tree_node_func func, void *data)
+int __init device_tree_for_each_node(const void *fdt,
+                                     device_tree_node_func func, void *data)
 {
     int node;
     int depth;
@@ -254,8 +260,8 @@ static int _find_compatible_node(const void *fdt,
     return 0;
 }
 
-int find_compatible_node(const char *compatible, int *node, int *depth,
-                u32 *address_cells, u32 *size_cells)
+int __init find_compatible_node(const char *compatible, int *node, int *depth,
+                                u32 *address_cells, u32 *size_cells)
 {
     int ret;
     struct find_compat c;
@@ -327,7 +333,7 @@ static int dump_node(const void *fdt, int node, const char *name, int depth,
  * device_tree_dump - print a text representation of a device tree
  * @fdt: flat device tree to print
  */
-void device_tree_dump(const void *fdt)
+void __init device_tree_dump(const void *fdt)
 {
     device_tree_for_each_node(fdt, dump_node, NULL);
 }
@@ -579,6 +585,54 @@ const void *dt_get_property(const struct dt_device_node *np,
     return pp ? pp->value : NULL;
 }
 
+bool_t dt_device_is_compatible(const struct dt_device_node *device,
+                               const char *compat)
+{
+    const char* cp;
+    u32 cplen, l;
+
+    cp = dt_get_property(device, "compatible", &cplen);
+    if ( cp == NULL )
+        return 0;
+    while ( cplen > 0 )
+    {
+        if ( dt_compat_cmp(cp, compat, strlen(compat)) == 0 )
+            return 1;
+        l = strlen(cp) + 1;
+        cp += l;
+        cplen -= l;
+    }
+
+    return 0;
+}
+
+bool_t dt_machine_is_compatible(const char *compat)
+{
+    const struct dt_device_node *root;
+    bool_t rc = 0;
+
+    root = dt_find_node_by_path("/");
+    if ( root )
+    {
+        rc = dt_device_is_compatible(root, compat);
+    }
+    return rc;
+}
+
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
+                                            const char *name)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    for_each_device_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            break;
+
+    return np;
+}
+
 struct dt_device_node *dt_find_node_by_path(const char *path)
 {
     struct dt_device_node *np;
@@ -590,6 +644,78 @@ struct dt_device_node *dt_find_node_by_path(const char *path)
     return np;
 }
 
+struct dt_device_node *dt_find_node_by_alias(const char *alias)
+{
+    const struct dt_alias_prop *app;
+
+    list_for_each_entry( app, &aliases_lookup, link )
+    {
+        if ( !strcmp(app->alias, alias) )
+            return app->np;
+    }
+
+    return NULL;
+}
+
+const struct dt_device_node *dt_get_parent(const struct dt_device_node *node)
+{
+    if ( !node )
+        return NULL;
+
+    return node->parent;
+}
+
+struct dt_device_node *
+dt_find_compatible_node(struct dt_device_node *from,
+                        const char *type,
+                        const char *compatible)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    for_each_device_node(dt, np)
+    {
+        if ( type
+             && !(np->type && (dt_node_cmp(np->type, type) == 0)) )
+            continue;
+        if ( dt_device_is_compatible(np, compatible) )
+            break;
+    }
+
+    return np;
+}
+
+int dt_n_addr_cells(const struct dt_device_node *np)
+{
+    const __be32 *ip;
+
+    do {
+        if ( np->parent )
+            np = np->parent;
+        ip = dt_get_property(np, "#address-cells", NULL);
+        if ( ip )
+            return be32_to_cpup(ip);
+    } while ( np->parent );
+    /* No #address-cells property for the root node */
+    return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
+}
+
+int dt_n_size_cells(const struct dt_device_node *np)
+{
+    const __be32 *ip;
+
+    do {
+        if ( np->parent )
+            np = np->parent;
+        ip = dt_get_property(np, "#size-cells", NULL);
+        if ( ip )
+            return be32_to_cpup(ip);
+    } while ( np->parent );
+    /* No #address-cells property for the root node */
+    return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
+}
+
 /**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 015b808..7a6adc7 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -107,22 +107,25 @@ typedef int (*device_tree_node_func)(const void *fdt,
 extern struct dt_early_info early_info;
 extern void *device_tree_flattened;
 
-size_t device_tree_early_init(const void *fdt);
-
-void device_tree_get_reg(const u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 *start, u64 *size);
-void device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
-                         u64 start, u64 size);
-u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name,
-			u32 dflt);
-bool_t device_tree_node_matches(const void *fdt, int node, const char *match);
-bool_t device_tree_node_compatible(const void *fdt, int node, const char *match);
-int find_compatible_node(const char *compatible, int *node, int *depth,
-                u32 *address_cells, u32 *size_cells);
-int device_tree_for_each_node(const void *fdt,
-                              device_tree_node_func func, void *data);
-const char *device_tree_bootargs(const void *fdt);
-void device_tree_dump(const void *fdt);
+size_t __init device_tree_early_init(const void *fdt);
+
+void __init device_tree_get_reg(const u32 **cell, u32 address_cells,
+                                u32 size_cells,
+                                u64 *start, u64 *size);
+void __init device_tree_set_reg(u32 **cell, u32 address_cells, u32 size_cells,
+                                u64 start, u64 size);
+u32 __init device_tree_get_u32(const void *fdt, int node,
+                               const char *prop_name, u32 dflt);
+bool_t __init device_tree_node_matches(const void *fdt, int node,
+                                       const char *match);
+bool_t __init device_tree_node_compatible(const void *fdt, int node,
+                                          const char *match);
+int __init find_compatible_node(const char *compatible, int *node, int *depth,
+                                u32 *address_cells, u32 *size_cells);
+int __init device_tree_for_each_node(const void *fdt,
+                                     device_tree_node_func func, void *data);
+const char __init *device_tree_bootargs(const void *fdt);
+void __init device_tree_dump(const void *fdt);
 
 /**
  * dt_unflatten_host_device_tree - Unflatten the host device tree
@@ -141,17 +144,72 @@ extern struct dt_device_node *dt_host;
 #define dt_node_cmp(s1, s2) strcmp((s1), (s2))
 #define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
 
+/* Default #address and #size cells */
+#define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define DT_ROOT_NODE_SIZE_CELLS_DEFAULT 1
+
 #define for_each_property_of_node(dn, pp)                   \
     for ( pp = dn->properties; pp != NULL; pp = pp->next )
 
 #define for_each_device_node(dt, dn)                         \
     for ( dn = dt; dn != NULL; dn = dn->allnext )
 
+/* Helper to read a big number; size is in cells (not bytes) */
+static inline u64 dt_read_number(const __be32 *cell, int size)
+{
+    u64 r = 0;
+
+    while ( size-- )
+        r = (r << 32) | be32_to_cpu(*(cell++));
+    return r;
+}
+
 static inline const char *dt_node_full_name(const struct dt_device_node *np)
 {
     return (np && np->full_name) ? np->full_name : "<no-node>";
 }
 
+static inline const char *dt_node_name(const struct dt_device_node *np)
+{
+    return (np && np->name) ? np->name : "<no-node>";
+}
+
+static inline bool_t
+dt_device_type_is_equal(const struct dt_device_node *device,
+                        const char *type)
+{
+    return !dt_node_cmp(device->type, type);
+}
+
+static inline void dt_device_set_used_by(struct dt_device_node *device,
+                                         domid_t used_by)
+{
+    /* TODO: children must inherit to the used_by thing */
+    device->used_by = used_by;
+}
+
+static inline domid_t dt_device_used_by(const struct dt_device_node *device)
+{
+    return device->used_by;
+}
+
+/**
+ * dt_find_compatible_node - Find a node based on type and one of the
+ *                           tokens in its "compatible" property
+ * @from: The node to start searching from or NULL, the node
+ *          you pass will not be searched, only the next one
+ *          will; typically, you pass what the previous call
+ *          returned.
+ * @type: The type string to match "device_type" or NULL to ignore
+ * @compatible: The string to match to one of the tokens in the device
+ *          "compatible" list.
+ *
+ * Returns a node pointer.
+ */
+struct dt_device_node *dt_find_compatible_node(struct dt_device_node *from,
+                                               const char *type,
+                                               const char *compatible);
+
 /**
  * Find a property with a given name for a given node
  * and return the value.
@@ -160,10 +218,75 @@ const void *dt_get_property(const struct dt_device_node *np,
                             const char *name, u32 *lenp);
 
 /**
+ * Checks if the given "compat" string matches one of the strings in
+ * the device's "compatible" property
+ */
+bool_t dt_device_is_compatible(const struct dt_device_node *device,
+                               const char *compat);
+
+/**
+ * dt_machine_is_compatible - Test root of device tree for a given compatible value
+ * @compat: compatible string to look for in root node's compatible property.
+ *
+ * Returns true if the root node has the given value in its
+ * compatible property.
+ */
+bool_t dt_machine_is_compatible(const char *compat);
+
+/**
+ * dt_find_node_by_name - Find a node by its "name" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ *  will; typically, you pass what the previous call
+ *  returned. of_node_put() will be called on it
+ * @name: The name string to match against
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
+                                            const char *name);
+
+/**
+ * df_find_node_by_alias - Find a node matching an alias
+ * @alias: The alias to match
+ *
+ * Returns a node pointer.
+ */
+struct dt_device_node *dt_find_node_by_alias(const char *alias);
+
+/**
  * dt_find_node_by_path - Find a node matching a full DT path
  * @path: The full path to match
  *
  * Returns a node pointer.
  */
 struct dt_device_node *dt_find_node_by_path(const char *path);
+
+/**
+ * dt_get_parent - Get a node's parent if any
+ * @node: Node to get parent
+ *
+ * Returns a node pointer.
+ */
+const struct dt_device_node *dt_get_parent(const struct dt_device_node *node);
+
+/**
+ * dt_n_size_cells - Helper to retrieve the number of cell for the size
+ * @np: node to get the value
+ *
+ * This function retrieves for a give device-tree node the number of
+ * cell for the size field.
+ */
+int dt_n_size_cells(const struct dt_device_node *np);
+
+/**
+ * dt_n_addr_cells - Helper to retrieve the number of cell for the address
+ * @np: node to get the value
+ *
+ * This function retrieves for a give device-tree node the number of
+ * cell for the address field.
+ */
+int dt_n_addr_cells(const struct dt_device_node *np);
+
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6M9-0003gy-Sw; Tue, 14 May 2013 03:56: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 1Uc6M8-0003ga-9O
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:52 +0000
Received: from [85.158.139.83:20761] by server-16.bemta-5.messagelabs.com id
	4E/33-31493-306B1915; Tue, 14 May 2013 03:56:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1368503809!32571332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23883 invoked from network); 14 May 2013 03:56:50 -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;
	14 May 2013 03:56: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 1Uc6M4-0003Ce-PZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6M4-0006S0-N3
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:48 +0000
Date: Tue, 14 May 2013 03:56:48 +0000
Message-Id: <E1Uc6M4-0006S0-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers to retrieve an
	address from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 227c02f8a627734761da130327d42b4c55aec1f4
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:28:21 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers to retrieve an address from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c      |  343 +++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/device_tree.h |   22 +++
 2 files changed, 365 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 92f2ac5..c1d1cf1 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -68,10 +68,38 @@ static LIST_HEAD(aliases_lookup);
 
 #ifdef DEBUG_DT
 # define dt_dprintk(fmt, args...) dt_printk(XENLOG_DEBUG fmt, ##args)
+static void dt_dump_addr(const char *s, const __be32 *addr, int na)
+{
+    dt_dprintk("%s", s);
+    while ( na-- )
+        dt_dprintk(" %08x", be32_to_cpu(*(addr++)));
+    dt_dprintk("\n");
+}
 #else
 # define dt_dprintk(fmt, args...) do {} while ( 0 )
+static void dt_dump_addr(const char *s, const __be32 *addr, int na) { }
 #endif
 
+#define DT_BAD_ADDR ((u64)-1)
+
+/* Max address size we deal with */
+#define DT_MAX_ADDR_CELLS 4
+#define DT_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= DT_MAX_ADDR_CELLS)
+#define DT_CHECK_COUNTS(na, ns) (DT_CHECK_ADDR_COUNT(na) && (ns) > 0)
+
+/* Callbacks for bus specific translators */
+struct dt_bus
+{
+    const char *name;
+    const char *addresses;
+    int (*match)(const struct dt_device_node *parent);
+    void (*count_cells)(const struct dt_device_node *child,
+                        int *addrc, int *sizec);
+    u64 (*map)(__be32 *addr, const __be32 *range, int na, int ns, int pna);
+    int (*translate)(__be32 *addr, u64 offset, int na);
+    unsigned int (*get_flags)(const __be32 *addr);
+};
+
 bool_t __init device_tree_node_matches(const void *fdt, int node,
                                        const char *match)
 {
@@ -716,6 +744,321 @@ int dt_n_size_cells(const struct dt_device_node *np)
     return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
 }
 
+/*
+ * Default translator (generic bus)
+ */
+static void dt_bus_default_count_cells(const struct dt_device_node *dev,
+                                int *addrc, int *sizec)
+{
+    if ( addrc )
+        *addrc = dt_n_addr_cells(dev);
+    if ( sizec )
+        *sizec = dt_n_size_cells(dev);
+}
+
+static u64 dt_bus_default_map(__be32 *addr, const __be32 *range,
+                              int na, int ns, int pna)
+{
+    u64 cp, s, da;
+
+    cp = dt_read_number(range, na);
+    s = dt_read_number(range + na + pna, ns);
+    da = dt_read_number(addr, na);
+
+    dt_dprintk("DT: default map, cp=%llx, s=%llx, da=%llx\n",
+               (unsigned long long)cp, (unsigned long long)s,
+               (unsigned long long)da);
+
+    /*
+     * If the number of address cells is larger than 2 we assume the
+     * mapping doesn't specify a physical address. Rather, the address
+     * specifies an identifier that must match exactly.
+     */
+    if ( na > 2 && memcmp(range, addr, na * 4) != 0 )
+        return DT_BAD_ADDR;
+
+    if ( da < cp || da >= (cp + s) )
+        return DT_BAD_ADDR;
+    return da - cp;
+}
+
+static int dt_bus_default_translate(__be32 *addr, u64 offset, int na)
+{
+    u64 a = dt_read_number(addr, na);
+
+    memset(addr, 0, na * 4);
+    a += offset;
+    if ( na > 1 )
+        addr[na - 2] = cpu_to_be32(a >> 32);
+    addr[na - 1] = cpu_to_be32(a & 0xffffffffu);
+
+    return 0;
+}
+static unsigned int dt_bus_default_get_flags(const __be32 *addr)
+{
+    /* TODO: Return the type of memory (device, ...) for caching
+     * attribute during mapping */
+    return 0;
+}
+
+/*
+ * Array of bus specific translators
+ */
+static const struct dt_bus dt_busses[] =
+{
+    /* Default */
+    {
+        .name = "default",
+        .addresses = "reg",
+        .match = NULL,
+        .count_cells = dt_bus_default_count_cells,
+        .map = dt_bus_default_map,
+        .translate = dt_bus_default_translate,
+        .get_flags = dt_bus_default_get_flags,
+    },
+};
+
+static const struct dt_bus *dt_match_bus(const struct dt_device_node *np)
+{
+    int i;
+
+    for ( i = 0; i < ARRAY_SIZE(dt_busses); i++ )
+        if ( !dt_busses[i].match || dt_busses[i].match(np) )
+            return &dt_busses[i];
+    BUG();
+
+    return NULL;
+}
+
+static const __be32 *dt_get_address(const struct dt_device_node *dev,
+                                    int index, u64 *size,
+                                    unsigned int *flags)
+{
+    const __be32 *prop;
+    u32 psize;
+    const struct dt_device_node *parent;
+    const struct dt_bus *bus;
+    int onesize, i, na, ns;
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        return NULL;
+    bus = dt_match_bus(parent);
+    bus->count_cells(dev, &na, &ns);
+
+    if ( !DT_CHECK_ADDR_COUNT(na) )
+        return NULL;
+
+    /* Get "reg" or "assigned-addresses" property */
+    prop = dt_get_property(dev, bus->addresses, &psize);
+    if ( prop == NULL )
+        return NULL;
+    psize /= 4;
+
+    onesize = na + ns;
+    for ( i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++ )
+    {
+        if ( i == index )
+        {
+            if ( size )
+                *size = dt_read_number(prop + na, ns);
+            if ( flags )
+                *flags = bus->get_flags(prop);
+            return prop;
+        }
+    }
+    return NULL;
+}
+
+static int dt_translate_one(const struct dt_device_node *parent,
+                            const struct dt_bus *bus,
+                            const struct dt_bus *pbus,
+                            __be32 *addr, int na, int ns,
+                            int pna, const char *rprop)
+{
+    const __be32 *ranges;
+    unsigned int rlen;
+    int rone;
+    u64 offset = DT_BAD_ADDR;
+
+    ranges = dt_get_property(parent, rprop, &rlen);
+    if ( ranges == NULL )
+    {
+        dt_printk(XENLOG_ERR "DT: no ranges; cannot translate\n");
+        return 1;
+    }
+    if ( ranges == NULL || rlen == 0 )
+    {
+        offset = dt_read_number(addr, na);
+        memset(addr, 0, pna * 4);
+        dt_dprintk("DT: empty ranges; 1:1 translation\n");
+        goto finish;
+    }
+
+    dt_dprintk("DT: walking ranges...\n");
+
+    /* Now walk through the ranges */
+    rlen /= 4;
+    rone = na + pna + ns;
+    for ( ; rlen >= rone; rlen -= rone, ranges += rone )
+    {
+        offset = bus->map(addr, ranges, na, ns, pna);
+        if ( offset != DT_BAD_ADDR )
+            break;
+    }
+    if ( offset == DT_BAD_ADDR )
+    {
+        dt_dprintk("DT: not found !\n");
+        return 1;
+    }
+    memcpy(addr, ranges + na, 4 * pna);
+
+finish:
+    dt_dump_addr("DT: parent translation for:", addr, pna);
+    dt_dprintk("DT: with offset: %llx\n", (unsigned long long)offset);
+
+    /* Translate it into parent bus space */
+    return pbus->translate(addr, offset, pna);
+}
+
+/*
+ * Translate an address from the device-tree into a CPU physical address,
+ * this walks up the tree and applies the various bus mappings on the
+ * way.
+ *
+ * Note: We consider that crossing any level with #size-cells == 0 to mean
+ * that translation is impossible (that is we are not dealing with a value
+ * that can be mapped to a cpu physical address). This is not really specified
+ * that way, but this is traditionally the way IBM at least do things
+ */
+static u64 __dt_translate_address(const struct dt_device_node *dev,
+                                  const __be32 *in_addr, const char *rprop)
+{
+    const struct dt_device_node *parent = NULL;
+    const struct dt_bus *bus, *pbus;
+    __be32 addr[DT_MAX_ADDR_CELLS];
+    int na, ns, pna, pns;
+    u64 result = DT_BAD_ADDR;
+
+    dt_dprintk("DT: ** translation for device %s **\n", dev->full_name);
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        goto bail;
+    bus = dt_match_bus(parent);
+
+    /* Count address cells & copy address locally */
+    bus->count_cells(dev, &na, &ns);
+    if ( !DT_CHECK_COUNTS(na, ns) )
+    {
+        dt_printk(XENLOG_ERR "dt_parse: Bad cell count for %s\n",
+                  dev->full_name);
+        goto bail;
+    }
+    memcpy(addr, in_addr, na * 4);
+
+    dt_dprintk("DT: bus is %s (na=%d, ns=%d) on %s\n",
+               bus->name, na, ns, parent->full_name);
+    dt_dump_addr("DT: translating address:", addr, na);
+
+    /* Translate */
+    for ( ;; )
+    {
+        /* Switch to parent bus */
+        dev = parent;
+        parent = dt_get_parent(dev);
+
+        /* If root, we have finished */
+        if ( parent == NULL )
+        {
+            dt_dprintk("DT: reached root node\n");
+            result = dt_read_number(addr, na);
+            break;
+        }
+
+        /* Get new parent bus and counts */
+        pbus = dt_match_bus(parent);
+        pbus->count_cells(dev, &pna, &pns);
+        if ( !DT_CHECK_COUNTS(pna, pns) )
+        {
+            printk(XENLOG_ERR "dt_parse: Bad cell count for %s\n",
+                   dev->full_name);
+            break;
+        }
+
+        dt_dprintk("DT: parent bus is %s (na=%d, ns=%d) on %s\n",
+                   pbus->name, pna, pns, parent->full_name);
+
+        /* Apply bus translation */
+        if ( dt_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop) )
+            break;
+
+        /* Complete the move up one level */
+        na = pna;
+        ns = pns;
+        bus = pbus;
+
+        dt_dump_addr("DT: one level translation:", addr, na);
+    }
+
+bail:
+    return result;
+}
+
+/* dt_device_address - Translate device tree address and return it */
+int dt_device_get_address(const struct dt_device_node *dev, int index,
+                          u64 *addr, u64 *size)
+{
+    const __be32 *addrp;
+    unsigned int flags;
+
+    addrp = dt_get_address(dev, index, size, &flags);
+    if ( addrp == NULL )
+        return -EINVAL;
+
+    if ( !addr )
+        return -EINVAL;
+
+    *addr = __dt_translate_address(dev, addrp, "ranges");
+
+    if ( *addr == DT_BAD_ADDR )
+        return -EINVAL;
+
+    return 0;
+}
+
+unsigned int dt_number_of_address(const struct dt_device_node *dev)
+{
+    const __be32 *prop;
+    u32 psize;
+    const struct dt_device_node *parent;
+    const struct dt_bus *bus;
+    int onesize, na, ns;
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        return 0;
+
+    bus = dt_match_bus(parent);
+    bus->count_cells(dev, &na, &ns);
+
+    if ( !DT_CHECK_COUNTS(na, ns) )
+        return 0;
+
+    /* Get "reg" or "assigned-addresses" property */
+    prop = dt_get_property(dev, bus->addresses, &psize);
+    if ( prop == NULL )
+        return 0;
+
+    psize /= 4;
+    onesize = na + ns;
+
+    return (psize / onesize);
+}
+
 /**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 7a6adc7..cc3a070 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -272,6 +272,28 @@ struct dt_device_node *dt_find_node_by_path(const char *path);
 const struct dt_device_node *dt_get_parent(const struct dt_device_node *node);
 
 /**
+ * dt_device_get_address - Resolve an address for a device
+ * @device: the device whose address is to be resolved
+ * @index: index of the address to resolve
+ * @addr: address filled by this function
+ * @size: size filled by this function
+ *
+ * This function resolves an address, walking the tree, for a give
+ * device-tree node. It returns 0 on success.
+ */
+int dt_device_get_address(const struct dt_device_node *dev, int index,
+                          u64 *addr, u64 *size);
+
+/**
+ * dt_number_of_address - Get the number of addresses for a device
+ * @device: the device whose number of address is to be retrieved
+ *
+ * Return the number of address for this device or 0 if there is no
+ * address or an error occurred.
+ */
+unsigned int dt_number_of_address(const struct dt_device_node *device);
+
+/**
  * dt_n_size_cells - Helper to retrieve the number of cell for the size
  * @np: node to get the value
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:56:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:56: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 1Uc6M9-0003gy-Sw; Tue, 14 May 2013 03:56: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 1Uc6M8-0003ga-9O
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:52 +0000
Received: from [85.158.139.83:20761] by server-16.bemta-5.messagelabs.com id
	4E/33-31493-306B1915; Tue, 14 May 2013 03:56:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1368503809!32571332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23883 invoked from network); 14 May 2013 03:56:50 -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;
	14 May 2013 03:56: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 1Uc6M4-0003Ce-PZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6M4-0006S0-N3
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:48 +0000
Date: Tue, 14 May 2013 03:56:48 +0000
Message-Id: <E1Uc6M4-0006S0-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers to retrieve an
	address from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 227c02f8a627734761da130327d42b4c55aec1f4
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:28:21 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers to retrieve an address from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c      |  343 +++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/device_tree.h |   22 +++
 2 files changed, 365 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 92f2ac5..c1d1cf1 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -68,10 +68,38 @@ static LIST_HEAD(aliases_lookup);
 
 #ifdef DEBUG_DT
 # define dt_dprintk(fmt, args...) dt_printk(XENLOG_DEBUG fmt, ##args)
+static void dt_dump_addr(const char *s, const __be32 *addr, int na)
+{
+    dt_dprintk("%s", s);
+    while ( na-- )
+        dt_dprintk(" %08x", be32_to_cpu(*(addr++)));
+    dt_dprintk("\n");
+}
 #else
 # define dt_dprintk(fmt, args...) do {} while ( 0 )
+static void dt_dump_addr(const char *s, const __be32 *addr, int na) { }
 #endif
 
+#define DT_BAD_ADDR ((u64)-1)
+
+/* Max address size we deal with */
+#define DT_MAX_ADDR_CELLS 4
+#define DT_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= DT_MAX_ADDR_CELLS)
+#define DT_CHECK_COUNTS(na, ns) (DT_CHECK_ADDR_COUNT(na) && (ns) > 0)
+
+/* Callbacks for bus specific translators */
+struct dt_bus
+{
+    const char *name;
+    const char *addresses;
+    int (*match)(const struct dt_device_node *parent);
+    void (*count_cells)(const struct dt_device_node *child,
+                        int *addrc, int *sizec);
+    u64 (*map)(__be32 *addr, const __be32 *range, int na, int ns, int pna);
+    int (*translate)(__be32 *addr, u64 offset, int na);
+    unsigned int (*get_flags)(const __be32 *addr);
+};
+
 bool_t __init device_tree_node_matches(const void *fdt, int node,
                                        const char *match)
 {
@@ -716,6 +744,321 @@ int dt_n_size_cells(const struct dt_device_node *np)
     return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
 }
 
+/*
+ * Default translator (generic bus)
+ */
+static void dt_bus_default_count_cells(const struct dt_device_node *dev,
+                                int *addrc, int *sizec)
+{
+    if ( addrc )
+        *addrc = dt_n_addr_cells(dev);
+    if ( sizec )
+        *sizec = dt_n_size_cells(dev);
+}
+
+static u64 dt_bus_default_map(__be32 *addr, const __be32 *range,
+                              int na, int ns, int pna)
+{
+    u64 cp, s, da;
+
+    cp = dt_read_number(range, na);
+    s = dt_read_number(range + na + pna, ns);
+    da = dt_read_number(addr, na);
+
+    dt_dprintk("DT: default map, cp=%llx, s=%llx, da=%llx\n",
+               (unsigned long long)cp, (unsigned long long)s,
+               (unsigned long long)da);
+
+    /*
+     * If the number of address cells is larger than 2 we assume the
+     * mapping doesn't specify a physical address. Rather, the address
+     * specifies an identifier that must match exactly.
+     */
+    if ( na > 2 && memcmp(range, addr, na * 4) != 0 )
+        return DT_BAD_ADDR;
+
+    if ( da < cp || da >= (cp + s) )
+        return DT_BAD_ADDR;
+    return da - cp;
+}
+
+static int dt_bus_default_translate(__be32 *addr, u64 offset, int na)
+{
+    u64 a = dt_read_number(addr, na);
+
+    memset(addr, 0, na * 4);
+    a += offset;
+    if ( na > 1 )
+        addr[na - 2] = cpu_to_be32(a >> 32);
+    addr[na - 1] = cpu_to_be32(a & 0xffffffffu);
+
+    return 0;
+}
+static unsigned int dt_bus_default_get_flags(const __be32 *addr)
+{
+    /* TODO: Return the type of memory (device, ...) for caching
+     * attribute during mapping */
+    return 0;
+}
+
+/*
+ * Array of bus specific translators
+ */
+static const struct dt_bus dt_busses[] =
+{
+    /* Default */
+    {
+        .name = "default",
+        .addresses = "reg",
+        .match = NULL,
+        .count_cells = dt_bus_default_count_cells,
+        .map = dt_bus_default_map,
+        .translate = dt_bus_default_translate,
+        .get_flags = dt_bus_default_get_flags,
+    },
+};
+
+static const struct dt_bus *dt_match_bus(const struct dt_device_node *np)
+{
+    int i;
+
+    for ( i = 0; i < ARRAY_SIZE(dt_busses); i++ )
+        if ( !dt_busses[i].match || dt_busses[i].match(np) )
+            return &dt_busses[i];
+    BUG();
+
+    return NULL;
+}
+
+static const __be32 *dt_get_address(const struct dt_device_node *dev,
+                                    int index, u64 *size,
+                                    unsigned int *flags)
+{
+    const __be32 *prop;
+    u32 psize;
+    const struct dt_device_node *parent;
+    const struct dt_bus *bus;
+    int onesize, i, na, ns;
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        return NULL;
+    bus = dt_match_bus(parent);
+    bus->count_cells(dev, &na, &ns);
+
+    if ( !DT_CHECK_ADDR_COUNT(na) )
+        return NULL;
+
+    /* Get "reg" or "assigned-addresses" property */
+    prop = dt_get_property(dev, bus->addresses, &psize);
+    if ( prop == NULL )
+        return NULL;
+    psize /= 4;
+
+    onesize = na + ns;
+    for ( i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++ )
+    {
+        if ( i == index )
+        {
+            if ( size )
+                *size = dt_read_number(prop + na, ns);
+            if ( flags )
+                *flags = bus->get_flags(prop);
+            return prop;
+        }
+    }
+    return NULL;
+}
+
+static int dt_translate_one(const struct dt_device_node *parent,
+                            const struct dt_bus *bus,
+                            const struct dt_bus *pbus,
+                            __be32 *addr, int na, int ns,
+                            int pna, const char *rprop)
+{
+    const __be32 *ranges;
+    unsigned int rlen;
+    int rone;
+    u64 offset = DT_BAD_ADDR;
+
+    ranges = dt_get_property(parent, rprop, &rlen);
+    if ( ranges == NULL )
+    {
+        dt_printk(XENLOG_ERR "DT: no ranges; cannot translate\n");
+        return 1;
+    }
+    if ( ranges == NULL || rlen == 0 )
+    {
+        offset = dt_read_number(addr, na);
+        memset(addr, 0, pna * 4);
+        dt_dprintk("DT: empty ranges; 1:1 translation\n");
+        goto finish;
+    }
+
+    dt_dprintk("DT: walking ranges...\n");
+
+    /* Now walk through the ranges */
+    rlen /= 4;
+    rone = na + pna + ns;
+    for ( ; rlen >= rone; rlen -= rone, ranges += rone )
+    {
+        offset = bus->map(addr, ranges, na, ns, pna);
+        if ( offset != DT_BAD_ADDR )
+            break;
+    }
+    if ( offset == DT_BAD_ADDR )
+    {
+        dt_dprintk("DT: not found !\n");
+        return 1;
+    }
+    memcpy(addr, ranges + na, 4 * pna);
+
+finish:
+    dt_dump_addr("DT: parent translation for:", addr, pna);
+    dt_dprintk("DT: with offset: %llx\n", (unsigned long long)offset);
+
+    /* Translate it into parent bus space */
+    return pbus->translate(addr, offset, pna);
+}
+
+/*
+ * Translate an address from the device-tree into a CPU physical address,
+ * this walks up the tree and applies the various bus mappings on the
+ * way.
+ *
+ * Note: We consider that crossing any level with #size-cells == 0 to mean
+ * that translation is impossible (that is we are not dealing with a value
+ * that can be mapped to a cpu physical address). This is not really specified
+ * that way, but this is traditionally the way IBM at least do things
+ */
+static u64 __dt_translate_address(const struct dt_device_node *dev,
+                                  const __be32 *in_addr, const char *rprop)
+{
+    const struct dt_device_node *parent = NULL;
+    const struct dt_bus *bus, *pbus;
+    __be32 addr[DT_MAX_ADDR_CELLS];
+    int na, ns, pna, pns;
+    u64 result = DT_BAD_ADDR;
+
+    dt_dprintk("DT: ** translation for device %s **\n", dev->full_name);
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        goto bail;
+    bus = dt_match_bus(parent);
+
+    /* Count address cells & copy address locally */
+    bus->count_cells(dev, &na, &ns);
+    if ( !DT_CHECK_COUNTS(na, ns) )
+    {
+        dt_printk(XENLOG_ERR "dt_parse: Bad cell count for %s\n",
+                  dev->full_name);
+        goto bail;
+    }
+    memcpy(addr, in_addr, na * 4);
+
+    dt_dprintk("DT: bus is %s (na=%d, ns=%d) on %s\n",
+               bus->name, na, ns, parent->full_name);
+    dt_dump_addr("DT: translating address:", addr, na);
+
+    /* Translate */
+    for ( ;; )
+    {
+        /* Switch to parent bus */
+        dev = parent;
+        parent = dt_get_parent(dev);
+
+        /* If root, we have finished */
+        if ( parent == NULL )
+        {
+            dt_dprintk("DT: reached root node\n");
+            result = dt_read_number(addr, na);
+            break;
+        }
+
+        /* Get new parent bus and counts */
+        pbus = dt_match_bus(parent);
+        pbus->count_cells(dev, &pna, &pns);
+        if ( !DT_CHECK_COUNTS(pna, pns) )
+        {
+            printk(XENLOG_ERR "dt_parse: Bad cell count for %s\n",
+                   dev->full_name);
+            break;
+        }
+
+        dt_dprintk("DT: parent bus is %s (na=%d, ns=%d) on %s\n",
+                   pbus->name, pna, pns, parent->full_name);
+
+        /* Apply bus translation */
+        if ( dt_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop) )
+            break;
+
+        /* Complete the move up one level */
+        na = pna;
+        ns = pns;
+        bus = pbus;
+
+        dt_dump_addr("DT: one level translation:", addr, na);
+    }
+
+bail:
+    return result;
+}
+
+/* dt_device_address - Translate device tree address and return it */
+int dt_device_get_address(const struct dt_device_node *dev, int index,
+                          u64 *addr, u64 *size)
+{
+    const __be32 *addrp;
+    unsigned int flags;
+
+    addrp = dt_get_address(dev, index, size, &flags);
+    if ( addrp == NULL )
+        return -EINVAL;
+
+    if ( !addr )
+        return -EINVAL;
+
+    *addr = __dt_translate_address(dev, addrp, "ranges");
+
+    if ( *addr == DT_BAD_ADDR )
+        return -EINVAL;
+
+    return 0;
+}
+
+unsigned int dt_number_of_address(const struct dt_device_node *dev)
+{
+    const __be32 *prop;
+    u32 psize;
+    const struct dt_device_node *parent;
+    const struct dt_bus *bus;
+    int onesize, na, ns;
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        return 0;
+
+    bus = dt_match_bus(parent);
+    bus->count_cells(dev, &na, &ns);
+
+    if ( !DT_CHECK_COUNTS(na, ns) )
+        return 0;
+
+    /* Get "reg" or "assigned-addresses" property */
+    prop = dt_get_property(dev, bus->addresses, &psize);
+    if ( prop == NULL )
+        return 0;
+
+    psize /= 4;
+    onesize = na + ns;
+
+    return (psize / onesize);
+}
+
 /**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 7a6adc7..cc3a070 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -272,6 +272,28 @@ struct dt_device_node *dt_find_node_by_path(const char *path);
 const struct dt_device_node *dt_get_parent(const struct dt_device_node *node);
 
 /**
+ * dt_device_get_address - Resolve an address for a device
+ * @device: the device whose address is to be resolved
+ * @index: index of the address to resolve
+ * @addr: address filled by this function
+ * @size: size filled by this function
+ *
+ * This function resolves an address, walking the tree, for a give
+ * device-tree node. It returns 0 on success.
+ */
+int dt_device_get_address(const struct dt_device_node *dev, int index,
+                          u64 *addr, u64 *size);
+
+/**
+ * dt_number_of_address - Get the number of addresses for a device
+ * @device: the device whose number of address is to be retrieved
+ *
+ * Return the number of address for this device or 0 if there is no
+ * address or an error occurred.
+ */
+unsigned int dt_number_of_address(const struct dt_device_node *device);
+
+/**
  * dt_n_size_cells - Helper to retrieve the number of cell for the size
  * @np: node to get the value
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:07 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6ML-0003j4-0H; Tue, 14 May 2013 03:57:05 +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 1Uc6MI-0003id-MM
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:03 +0000
Received: from [85.158.139.211:51369] by server-3.bemta-5.messagelabs.com id
	E0/5D-31108-D06B1915; Tue, 14 May 2013 03:57:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1368503819!18429551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10353 invoked from network); 14 May 2013 03:57:00 -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;
	14 May 2013 03:57: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 1Uc6ME-0003Cp-VX
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6ME-0006SM-U3
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:58 +0000
Date: Tue, 14 May 2013 03:56:58 +0000
Message-Id: <E1Uc6ME-0006SM-U3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers to retrieve an
	interrupt description from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 886f34045bf0c554c8fc43aaccc9883938e928bd
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:33:01 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers to retrieve an interrupt description from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c      |  362 +++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/device_tree.h |  130 +++++++++++++++
 2 files changed, 492 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index c1d1cf1..7f632b9 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -27,8 +27,11 @@
 
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
+dt_irq_xlate_func dt_irq_xlate;
 /* Host device tree */
 struct dt_device_node *dt_host;
+/* Interrupt controller node*/
+const struct dt_device_node *dt_interrupt_controller;
 
 /**
  * struct dt_alias_prop - Alias property in 'aliases' node
@@ -1029,6 +1032,81 @@ int dt_device_get_address(const struct dt_device_node *dev, int index,
     return 0;
 }
 
+/**
+ * dt_find_node_by_phandle - Find a node given a phandle
+ * @handle: phandle of the node to find
+ *
+ * Returns a node pointer.
+ */
+static const struct dt_device_node *dt_find_node_by_phandle(dt_phandle handle)
+{
+    const struct dt_device_node *np;
+
+    for_each_device_node(dt_host, np)
+        if ( np->phandle == handle )
+            break;
+
+    return np;
+}
+
+/**
+ * dt_irq_find_parent - Given a device node, find its interrupt parent node
+ * @child: pointer to device node
+ *
+ * Returns a pointer to the interrupt parent node, or NULL if the interrupt
+ * parent could not be determined.
+ */
+static const struct dt_device_node *
+dt_irq_find_parent(const struct dt_device_node *child)
+{
+    const struct dt_device_node *p;
+    const __be32 *parp;
+
+    do
+    {
+        parp = dt_get_property(child, "interrupt-parent", NULL);
+        if ( parp == NULL )
+            p = dt_get_parent(child);
+        else
+            p = dt_find_node_by_phandle(be32_to_cpup(parp));
+        child = p;
+    } while ( p && dt_get_property(p, "#interrupt-cells", NULL) == NULL );
+
+    return p;
+}
+
+unsigned int dt_number_of_irq(const struct dt_device_node *device)
+{
+    const struct dt_device_node *p;
+    const __be32 *intspec, *tmp;
+    u32 intsize, intlen;
+
+    dt_dprintk("dt_irq_number: dev=%s\n", device->full_name);
+
+    /* Get the interrupts property */
+    intspec = dt_get_property(device, "interrupts", &intlen);
+    if ( intspec == NULL )
+        return 0;
+    intlen /= sizeof(*intspec);
+
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+
+    /* Look for the interrupt parent. */
+    p = dt_irq_find_parent(device);
+    if ( p == NULL )
+        return 0;
+
+    /* Get size of interrupt specifier */
+    tmp = dt_get_property(p, "#interrupt-cells", NULL);
+    if ( tmp == NULL )
+        return 0;
+    intsize = be32_to_cpu(*tmp);
+
+    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
+
+    return (intlen / intsize);
+}
+
 unsigned int dt_number_of_address(const struct dt_device_node *dev)
 {
     const __be32 *prop;
@@ -1060,6 +1138,274 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
 }
 
 /**
+ * dt_irq_map_raw - Low level interrupt tree parsing
+ * @parent:     the device interrupt parent
+ * @intspec:    interrupt specifier ("interrupts" property of the device)
+ * @ointsize:   size of the passed in interrupt specifier
+ * @addr:       address specifier (start of "reg" property of the device)
+ * @oirq:       structure dt_raw_irq filled by this function
+ *
+ * Returns 0 on success and a negative number on error
+ *
+ * This function is a low-level interrupt tree walking function. It
+ * can be used to do a partial walk with synthesized reg and interrupts
+ * properties, for example when resolving PCI interrupts when no device
+ * node exist for the parent.
+ */
+static int dt_irq_map_raw(const struct dt_device_node *parent,
+                          const __be32 *intspec, u32 ointsize,
+                          const __be32 *addr,
+                          struct dt_raw_irq *oirq)
+{
+    const struct dt_device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
+    const __be32 *tmp, *imap, *imask;
+    u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
+    u32 imaplen;
+    int match, i;
+
+    dt_dprintk("dt_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
+               parent->full_name, be32_to_cpup(intspec),
+               be32_to_cpup(intspec + 1), ointsize);
+
+    ipar = parent;
+
+    /* First get the #interrupt-cells property of the current cursor
+     * that tells us how to interpret the passed-in intspec. If there
+     * is none, we are nice and just walk up the tree
+     */
+    do {
+        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
+        if ( tmp != NULL )
+        {
+            intsize = be32_to_cpu(*tmp);
+            break;
+        }
+        tnode = ipar;
+        ipar = dt_irq_find_parent(ipar);
+    } while ( ipar );
+    if ( ipar == NULL )
+    {
+        dt_dprintk(" -> no parent found !\n");
+        goto fail;
+    }
+
+    dt_dprintk("dt_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize);
+
+    if ( ointsize != intsize )
+        return -EINVAL;
+
+    /* Look for this #address-cells. We have to implement the old linux
+     * trick of looking for the parent here as some device-trees rely on it
+     */
+    old = ipar;
+    do {
+        tmp = dt_get_property(old, "#address-cells", NULL);
+        tnode = dt_get_parent(old);
+        old = tnode;
+    } while ( old && tmp == NULL );
+
+    old = NULL;
+    addrsize = (tmp == NULL) ? 2 : be32_to_cpu(*tmp);
+
+    dt_dprintk(" -> addrsize=%d\n", addrsize);
+
+    /* Now start the actual "proper" walk of the interrupt tree */
+    while ( ipar != NULL )
+    {
+        /* Now check if cursor is an interrupt-controller and if it is
+         * then we are done
+         */
+        if ( dt_get_property(ipar, "interrupt-controller", NULL) != NULL )
+        {
+            dt_dprintk(" -> got it !\n");
+            if ( intsize > DT_MAX_IRQ_SPEC )
+            {
+                dt_dprintk(" -> intsize(%u) greater than DT_MAX_IRQ_SPEC(%u)\n",
+                           intsize, DT_MAX_IRQ_SPEC);
+                goto fail;
+            }
+            for ( i = 0; i < intsize; i++ )
+                oirq->specifier[i] = dt_read_number(intspec + i, 1);
+            oirq->size = intsize;
+            oirq->controller = ipar;
+            return 0;
+        }
+
+        /* Now look for an interrupt-map */
+        imap = dt_get_property(ipar, "interrupt-map", &imaplen);
+        /* No interrupt map, check for an interrupt parent */
+        if ( imap == NULL )
+        {
+            dt_dprintk(" -> no map, getting parent\n");
+            newpar = dt_irq_find_parent(ipar);
+            goto skiplevel;
+        }
+        imaplen /= sizeof(u32);
+
+        /* Look for a mask */
+        imask = dt_get_property(ipar, "interrupt-map-mask", NULL);
+
+        /* If we were passed no "reg" property and we attempt to parse
+         * an interrupt-map, then #address-cells must be 0.
+         * Fail if it's not.
+         */
+        if ( addr == NULL && addrsize != 0 )
+        {
+            dt_dprintk(" -> no reg passed in when needed !\n");
+            goto fail;
+        }
+
+        /* Parse interrupt-map */
+        match = 0;
+        while ( imaplen > (addrsize + intsize + 1) && !match )
+        {
+            /* Compare specifiers */
+            match = 1;
+            for ( i = 0; i < addrsize && match; ++i )
+            {
+                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
+                match = ((addr[i] ^ imap[i]) & mask) == 0;
+            }
+            for ( ; i < (addrsize + intsize) && match; ++i )
+            {
+                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
+                match = ((intspec[i-addrsize] ^ imap[i]) & mask) == 0;
+            }
+            imap += addrsize + intsize;
+            imaplen -= addrsize + intsize;
+
+            dt_dprintk(" -> match=%d (imaplen=%d)\n", match, imaplen);
+
+            /* Get the interrupt parent */
+            newpar = dt_find_node_by_phandle(be32_to_cpup(imap));
+            imap++;
+            --imaplen;
+
+            /* Check if not found */
+            if ( newpar == NULL )
+            {
+                dt_dprintk(" -> imap parent not found !\n");
+                goto fail;
+            }
+
+            /* Get #interrupt-cells and #address-cells of new
+             * parent
+             */
+            tmp = dt_get_property(newpar, "#interrupt-cells", NULL);
+            if ( tmp == NULL )
+            {
+                dt_dprintk(" -> parent lacks #interrupt-cells!\n");
+                goto fail;
+            }
+            newintsize = be32_to_cpu(*tmp);
+            tmp = dt_get_property(newpar, "#address-cells", NULL);
+            newaddrsize = (tmp == NULL) ? 0 : be32_to_cpu(*tmp);
+
+            dt_dprintk(" -> newintsize=%d, newaddrsize=%d\n",
+                       newintsize, newaddrsize);
+
+            /* Check for malformed properties */
+            if ( imaplen < (newaddrsize + newintsize) )
+                goto fail;
+
+            imap += newaddrsize + newintsize;
+            imaplen -= newaddrsize + newintsize;
+
+            dt_dprintk(" -> imaplen=%d\n", imaplen);
+        }
+        if ( !match )
+            goto fail;
+
+        old = newpar;
+        addrsize = newaddrsize;
+        intsize = newintsize;
+        intspec = imap - intsize;
+        addr = intspec - addrsize;
+
+    skiplevel:
+        /* Iterate again with new parent */
+        dt_dprintk(" -> new parent: %s\n", dt_node_full_name(newpar));
+        ipar = newpar;
+        newpar = NULL;
+    }
+fail:
+    return -EINVAL;
+}
+
+int dt_device_get_raw_irq(const struct dt_device_node *device, int index,
+                          struct dt_raw_irq *out_irq)
+{
+    const struct dt_device_node *p;
+    const __be32 *intspec, *tmp, *addr;
+    u32 intsize, intlen;
+    int res = -EINVAL;
+
+    dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%d\n",
+               device->full_name, index);
+
+    /* Get the interrupts property */
+    intspec = dt_get_property(device, "interrupts", &intlen);
+    if ( intspec == NULL )
+        return -EINVAL;
+    intlen /= sizeof(*intspec);
+
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+
+    /* Get the reg property (if any) */
+    addr = dt_get_property(device, "reg", NULL);
+
+    /* Look for the interrupt parent. */
+    p = dt_irq_find_parent(device);
+    if ( p == NULL )
+        return -EINVAL;
+
+    /* Get size of interrupt specifier */
+    tmp = dt_get_property(p, "#interrupt-cells", NULL);
+    if ( tmp == NULL )
+        goto out;
+    intsize = be32_to_cpu(*tmp);
+
+    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
+
+    /* Check index */
+    if ( (index + 1) * intsize > intlen )
+        goto out;
+
+    /* Get new specifier and map it */
+    res = dt_irq_map_raw(p, intspec + index * intsize, intsize,
+                         addr, out_irq);
+    if ( res )
+        goto out;
+out:
+    return res;
+}
+
+int dt_irq_translate(const struct dt_raw_irq *raw,
+                     struct dt_irq *out_irq)
+{
+    ASSERT(dt_irq_xlate != NULL);
+
+    /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
+
+    return dt_irq_xlate(raw->specifier, raw->size,
+                        &out_irq->irq, &out_irq->type);
+}
+
+int dt_device_get_irq(const struct dt_device_node *device, int index,
+                      struct dt_irq *out_irq)
+{
+    struct dt_raw_irq raw;
+    int res;
+
+    res = dt_device_get_raw_irq(device, index, &raw);
+
+    if ( res )
+        return res;
+
+    return dt_irq_translate(&raw, out_irq);
+}
+
+/**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
  * @mem: Memory chunk to use for allocating device nodes and properties
@@ -1401,6 +1747,22 @@ static void __init dt_alias_scan(void)
     }
 }
 
+struct dt_device_node * __init dt_find_interrupt_controller(const char *compat)
+{
+    struct dt_device_node *np = NULL;
+
+    while ( (np = dt_find_compatible_node(np, NULL, compat)) )
+    {
+        if ( !dt_find_property(np, "interrupt-controller", NULL) )
+            continue;
+
+        if ( dt_get_parent(np) )
+            break;
+    }
+
+    return np;
+}
+
 void __init dt_unflatten_host_device_tree(void)
 {
     __unflatten_device_tree(device_tree_flattened, &dt_host);
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index cc3a070..a7cfa94 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -99,6 +99,67 @@ struct dt_device_node {
 
 };
 
+/**
+ * IRQ line type.
+ *
+ * DT_IRQ_TYPE_NONE            - default, unspecified type
+ * DT_IRQ_TYPE_EDGE_RISING     - rising edge triggered
+ * DT_IRQ_TYPE_EDGE_FALLING    - falling edge triggered
+ * DT_IRQ_TYPE_EDGE_BOTH       - rising and falling edge triggered
+ * DT_IRQ_TYPE_LEVEL_HIGH      - high level triggered
+ * DT_IRQ_TYPE_LEVEL_LOW       - low level triggered
+ * DT_IRQ_TYPE_LEVEL_MASK      - Mask to filter out the level bits
+ * DT_IRQ_TYPE_SENSE_MASK      - Mask for all the above bits
+ */
+#define DT_IRQ_TYPE_NONE           0x00000000
+#define DT_IRQ_TYPE_EDGE_RISING    0x00000001
+#define DT_IRQ_TYPE_EDGE_FALLING   0x00000002
+#define DT_IRQ_TYPE_EDGE_BOTH                           \
+    (DT_IRQ_TYPE_EDGE_FALLING | DT_IRQ_TYPE_EDGE_RISING)
+#define DT_IRQ_TYPE_LEVEL_HIGH     0x00000004
+#define DT_IRQ_TYPE_LEVEL_LOW      0x00000008
+#define DT_IRQ_TYPE_LEVEL_MASK                          \
+    (DT_IRQ_TYPE_LEVEL_LOW | DT_IRQ_TYPE_LEVEL_HIGH)
+#define DT_IRQ_TYPE_SENSE_MASK     0x0000000f
+
+/**
+ * dt_irq - describe an IRQ in the device tree
+ * @irq: IRQ number
+ * @type: IRQ type (see DT_IRQ_TYPE_*)
+ *
+ * This structure is returned when an interrupt is mapped.
+ */
+struct dt_irq {
+    unsigned int irq;
+    unsigned int type;
+};
+
+/* If type == DT_IRQ_TYPE_NONE, assume we use level triggered */
+static inline bool_t dt_irq_is_level_triggered(const struct dt_irq *irq)
+{
+    unsigned int type = irq->type;
+
+    return (type & DT_IRQ_TYPE_LEVEL_MASK) || (type == DT_IRQ_TYPE_NONE);
+}
+
+/**
+ * dt_raw_irq - container for device_node/irq_specifier for an irq controller
+ * @controller: pointer to interrupt controller deivce tree node
+ * @size: size of interrupt specifier
+ * @specifier: array of cells @size long specifying the specific interrupt
+ *
+ * This structure is returned when an interrupt is mapped but not translated.
+ */
+#define DT_MAX_IRQ_SPEC     4 /* We handle specifiers of at most 4 cells */
+struct dt_raw_irq {
+    const struct dt_device_node *controller;
+    u32 size;
+    u32 specifier[DT_MAX_IRQ_SPEC];
+};
+
+#define dt_irq(irq) ((irq)->irq)
+#define dt_irq_flags(irq) ((irq)->flags)
+
 typedef int (*device_tree_node_func)(const void *fdt,
                                      int node, const char *name, int depth,
                                      u32 address_cells, u32 size_cells,
@@ -136,11 +197,40 @@ void __init device_tree_dump(const void *fdt);
 void __init dt_unflatten_host_device_tree(void);
 
 /**
+ * IRQ translation callback
+ * TODO: For the moment we assume that we only have ONE
+ * interrupt-controller.
+ */
+typedef int (*dt_irq_xlate_func)(const u32 *intspec, unsigned int intsize,
+                                 unsigned int *out_hwirq,
+                                 unsigned int *out_type);
+extern dt_irq_xlate_func dt_irq_xlate;
+
+/**
  * Host device tree
  * DO NOT modify it!
  */
 extern struct dt_device_node *dt_host;
 
+/**
+ * Primary interrupt controller
+ * Exynos SOC has an interrupt combiner, interrupt has no physical
+ * meaning when it's not connected to the primary controller.
+ * We will only map interrupt whose parent controller is
+ * dt_interrupt_controller. It should always be a GIC.
+ * TODO: Handle multiple GIC
+ */
+extern const struct dt_device_node *dt_interrupt_controller;
+
+/**
+ * Find the interrupt controller
+ * For the moment we handle only one interrupt controller: the first
+ * one without parent which is compatible with the string "compat".
+ *
+ * If found, return the interrupt controller device node.
+ */
+struct dt_device_node * __init dt_find_interrupt_controller(const char *compat);
+
 #define dt_node_cmp(s1, s2) strcmp((s1), (s2))
 #define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
 
@@ -285,6 +375,15 @@ int dt_device_get_address(const struct dt_device_node *dev, int index,
                           u64 *addr, u64 *size);
 
 /**
+ * dt_number_of_irq - Get the number of IRQ for a device
+ * @device: the device whose number of interrupt is to be retrieved
+ *
+ * Return the number of irq for this device or 0 if there is no
+ * interrupt or an error occurred.
+ */
+unsigned int dt_number_of_irq(const struct dt_device_node *device);
+
+/**
  * dt_number_of_address - Get the number of addresses for a device
  * @device: the device whose number of address is to be retrieved
  *
@@ -294,6 +393,37 @@ int dt_device_get_address(const struct dt_device_node *dev, int index,
 unsigned int dt_number_of_address(const struct dt_device_node *device);
 
 /**
+ * dt_device_get_irq - Resolve an interrupt for a device
+ * @device: the device whose interrupt is to be resolved
+ * @index: index of the interrupt to resolve
+ * @out_irq: structure dt_irq filled by this function
+ *
+ * This function resolves an interrupt, walking the tree, for a given
+ * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
+ */
+int dt_device_get_irq(const struct dt_device_node *device, int index,
+                      struct dt_irq *irq);
+
+/**
+ * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
+ * @device: the device whose interrupt is to be resolved
+ * @index: index of the interrupt to resolve
+ * @out_irq: structure dt_raw_irq filled by this function
+ *
+ * This function resolves an interrupt for a device, no translation is
+ * made. dt_irq_translate can be called after.
+ */
+int dt_device_get_raw_irq(const struct dt_device_node *device, int index,
+                          struct dt_raw_irq *irq);
+
+/**
+ * dt_irq_translate - Translate an irq
+ * @raw: IRQ to translate (raw format)
+ * @out_irq: structure dt_irq filled by this function
+ */
+int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
+
+/**
  * dt_n_size_cells - Helper to retrieve the number of cell for the size
  * @np: node to get the value
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:07 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6ML-0003j4-0H; Tue, 14 May 2013 03:57:05 +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 1Uc6MI-0003id-MM
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:03 +0000
Received: from [85.158.139.211:51369] by server-3.bemta-5.messagelabs.com id
	E0/5D-31108-D06B1915; Tue, 14 May 2013 03:57:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1368503819!18429551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10353 invoked from network); 14 May 2013 03:57:00 -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;
	14 May 2013 03:57: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 1Uc6ME-0003Cp-VX
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6ME-0006SM-U3
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:56:58 +0000
Date: Tue, 14 May 2013 03:56:58 +0000
Message-Id: <E1Uc6ME-0006SM-U3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add helpers to retrieve an
	interrupt description from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 886f34045bf0c554c8fc43aaccc9883938e928bd
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:33:01 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:57 2013 +0100

    xen/arm: Add helpers to retrieve an interrupt description from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c      |  362 +++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/device_tree.h |  130 +++++++++++++++
 2 files changed, 492 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index c1d1cf1..7f632b9 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -27,8 +27,11 @@
 
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
+dt_irq_xlate_func dt_irq_xlate;
 /* Host device tree */
 struct dt_device_node *dt_host;
+/* Interrupt controller node*/
+const struct dt_device_node *dt_interrupt_controller;
 
 /**
  * struct dt_alias_prop - Alias property in 'aliases' node
@@ -1029,6 +1032,81 @@ int dt_device_get_address(const struct dt_device_node *dev, int index,
     return 0;
 }
 
+/**
+ * dt_find_node_by_phandle - Find a node given a phandle
+ * @handle: phandle of the node to find
+ *
+ * Returns a node pointer.
+ */
+static const struct dt_device_node *dt_find_node_by_phandle(dt_phandle handle)
+{
+    const struct dt_device_node *np;
+
+    for_each_device_node(dt_host, np)
+        if ( np->phandle == handle )
+            break;
+
+    return np;
+}
+
+/**
+ * dt_irq_find_parent - Given a device node, find its interrupt parent node
+ * @child: pointer to device node
+ *
+ * Returns a pointer to the interrupt parent node, or NULL if the interrupt
+ * parent could not be determined.
+ */
+static const struct dt_device_node *
+dt_irq_find_parent(const struct dt_device_node *child)
+{
+    const struct dt_device_node *p;
+    const __be32 *parp;
+
+    do
+    {
+        parp = dt_get_property(child, "interrupt-parent", NULL);
+        if ( parp == NULL )
+            p = dt_get_parent(child);
+        else
+            p = dt_find_node_by_phandle(be32_to_cpup(parp));
+        child = p;
+    } while ( p && dt_get_property(p, "#interrupt-cells", NULL) == NULL );
+
+    return p;
+}
+
+unsigned int dt_number_of_irq(const struct dt_device_node *device)
+{
+    const struct dt_device_node *p;
+    const __be32 *intspec, *tmp;
+    u32 intsize, intlen;
+
+    dt_dprintk("dt_irq_number: dev=%s\n", device->full_name);
+
+    /* Get the interrupts property */
+    intspec = dt_get_property(device, "interrupts", &intlen);
+    if ( intspec == NULL )
+        return 0;
+    intlen /= sizeof(*intspec);
+
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+
+    /* Look for the interrupt parent. */
+    p = dt_irq_find_parent(device);
+    if ( p == NULL )
+        return 0;
+
+    /* Get size of interrupt specifier */
+    tmp = dt_get_property(p, "#interrupt-cells", NULL);
+    if ( tmp == NULL )
+        return 0;
+    intsize = be32_to_cpu(*tmp);
+
+    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
+
+    return (intlen / intsize);
+}
+
 unsigned int dt_number_of_address(const struct dt_device_node *dev)
 {
     const __be32 *prop;
@@ -1060,6 +1138,274 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
 }
 
 /**
+ * dt_irq_map_raw - Low level interrupt tree parsing
+ * @parent:     the device interrupt parent
+ * @intspec:    interrupt specifier ("interrupts" property of the device)
+ * @ointsize:   size of the passed in interrupt specifier
+ * @addr:       address specifier (start of "reg" property of the device)
+ * @oirq:       structure dt_raw_irq filled by this function
+ *
+ * Returns 0 on success and a negative number on error
+ *
+ * This function is a low-level interrupt tree walking function. It
+ * can be used to do a partial walk with synthesized reg and interrupts
+ * properties, for example when resolving PCI interrupts when no device
+ * node exist for the parent.
+ */
+static int dt_irq_map_raw(const struct dt_device_node *parent,
+                          const __be32 *intspec, u32 ointsize,
+                          const __be32 *addr,
+                          struct dt_raw_irq *oirq)
+{
+    const struct dt_device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
+    const __be32 *tmp, *imap, *imask;
+    u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
+    u32 imaplen;
+    int match, i;
+
+    dt_dprintk("dt_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
+               parent->full_name, be32_to_cpup(intspec),
+               be32_to_cpup(intspec + 1), ointsize);
+
+    ipar = parent;
+
+    /* First get the #interrupt-cells property of the current cursor
+     * that tells us how to interpret the passed-in intspec. If there
+     * is none, we are nice and just walk up the tree
+     */
+    do {
+        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
+        if ( tmp != NULL )
+        {
+            intsize = be32_to_cpu(*tmp);
+            break;
+        }
+        tnode = ipar;
+        ipar = dt_irq_find_parent(ipar);
+    } while ( ipar );
+    if ( ipar == NULL )
+    {
+        dt_dprintk(" -> no parent found !\n");
+        goto fail;
+    }
+
+    dt_dprintk("dt_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize);
+
+    if ( ointsize != intsize )
+        return -EINVAL;
+
+    /* Look for this #address-cells. We have to implement the old linux
+     * trick of looking for the parent here as some device-trees rely on it
+     */
+    old = ipar;
+    do {
+        tmp = dt_get_property(old, "#address-cells", NULL);
+        tnode = dt_get_parent(old);
+        old = tnode;
+    } while ( old && tmp == NULL );
+
+    old = NULL;
+    addrsize = (tmp == NULL) ? 2 : be32_to_cpu(*tmp);
+
+    dt_dprintk(" -> addrsize=%d\n", addrsize);
+
+    /* Now start the actual "proper" walk of the interrupt tree */
+    while ( ipar != NULL )
+    {
+        /* Now check if cursor is an interrupt-controller and if it is
+         * then we are done
+         */
+        if ( dt_get_property(ipar, "interrupt-controller", NULL) != NULL )
+        {
+            dt_dprintk(" -> got it !\n");
+            if ( intsize > DT_MAX_IRQ_SPEC )
+            {
+                dt_dprintk(" -> intsize(%u) greater than DT_MAX_IRQ_SPEC(%u)\n",
+                           intsize, DT_MAX_IRQ_SPEC);
+                goto fail;
+            }
+            for ( i = 0; i < intsize; i++ )
+                oirq->specifier[i] = dt_read_number(intspec + i, 1);
+            oirq->size = intsize;
+            oirq->controller = ipar;
+            return 0;
+        }
+
+        /* Now look for an interrupt-map */
+        imap = dt_get_property(ipar, "interrupt-map", &imaplen);
+        /* No interrupt map, check for an interrupt parent */
+        if ( imap == NULL )
+        {
+            dt_dprintk(" -> no map, getting parent\n");
+            newpar = dt_irq_find_parent(ipar);
+            goto skiplevel;
+        }
+        imaplen /= sizeof(u32);
+
+        /* Look for a mask */
+        imask = dt_get_property(ipar, "interrupt-map-mask", NULL);
+
+        /* If we were passed no "reg" property and we attempt to parse
+         * an interrupt-map, then #address-cells must be 0.
+         * Fail if it's not.
+         */
+        if ( addr == NULL && addrsize != 0 )
+        {
+            dt_dprintk(" -> no reg passed in when needed !\n");
+            goto fail;
+        }
+
+        /* Parse interrupt-map */
+        match = 0;
+        while ( imaplen > (addrsize + intsize + 1) && !match )
+        {
+            /* Compare specifiers */
+            match = 1;
+            for ( i = 0; i < addrsize && match; ++i )
+            {
+                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
+                match = ((addr[i] ^ imap[i]) & mask) == 0;
+            }
+            for ( ; i < (addrsize + intsize) && match; ++i )
+            {
+                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
+                match = ((intspec[i-addrsize] ^ imap[i]) & mask) == 0;
+            }
+            imap += addrsize + intsize;
+            imaplen -= addrsize + intsize;
+
+            dt_dprintk(" -> match=%d (imaplen=%d)\n", match, imaplen);
+
+            /* Get the interrupt parent */
+            newpar = dt_find_node_by_phandle(be32_to_cpup(imap));
+            imap++;
+            --imaplen;
+
+            /* Check if not found */
+            if ( newpar == NULL )
+            {
+                dt_dprintk(" -> imap parent not found !\n");
+                goto fail;
+            }
+
+            /* Get #interrupt-cells and #address-cells of new
+             * parent
+             */
+            tmp = dt_get_property(newpar, "#interrupt-cells", NULL);
+            if ( tmp == NULL )
+            {
+                dt_dprintk(" -> parent lacks #interrupt-cells!\n");
+                goto fail;
+            }
+            newintsize = be32_to_cpu(*tmp);
+            tmp = dt_get_property(newpar, "#address-cells", NULL);
+            newaddrsize = (tmp == NULL) ? 0 : be32_to_cpu(*tmp);
+
+            dt_dprintk(" -> newintsize=%d, newaddrsize=%d\n",
+                       newintsize, newaddrsize);
+
+            /* Check for malformed properties */
+            if ( imaplen < (newaddrsize + newintsize) )
+                goto fail;
+
+            imap += newaddrsize + newintsize;
+            imaplen -= newaddrsize + newintsize;
+
+            dt_dprintk(" -> imaplen=%d\n", imaplen);
+        }
+        if ( !match )
+            goto fail;
+
+        old = newpar;
+        addrsize = newaddrsize;
+        intsize = newintsize;
+        intspec = imap - intsize;
+        addr = intspec - addrsize;
+
+    skiplevel:
+        /* Iterate again with new parent */
+        dt_dprintk(" -> new parent: %s\n", dt_node_full_name(newpar));
+        ipar = newpar;
+        newpar = NULL;
+    }
+fail:
+    return -EINVAL;
+}
+
+int dt_device_get_raw_irq(const struct dt_device_node *device, int index,
+                          struct dt_raw_irq *out_irq)
+{
+    const struct dt_device_node *p;
+    const __be32 *intspec, *tmp, *addr;
+    u32 intsize, intlen;
+    int res = -EINVAL;
+
+    dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%d\n",
+               device->full_name, index);
+
+    /* Get the interrupts property */
+    intspec = dt_get_property(device, "interrupts", &intlen);
+    if ( intspec == NULL )
+        return -EINVAL;
+    intlen /= sizeof(*intspec);
+
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+
+    /* Get the reg property (if any) */
+    addr = dt_get_property(device, "reg", NULL);
+
+    /* Look for the interrupt parent. */
+    p = dt_irq_find_parent(device);
+    if ( p == NULL )
+        return -EINVAL;
+
+    /* Get size of interrupt specifier */
+    tmp = dt_get_property(p, "#interrupt-cells", NULL);
+    if ( tmp == NULL )
+        goto out;
+    intsize = be32_to_cpu(*tmp);
+
+    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
+
+    /* Check index */
+    if ( (index + 1) * intsize > intlen )
+        goto out;
+
+    /* Get new specifier and map it */
+    res = dt_irq_map_raw(p, intspec + index * intsize, intsize,
+                         addr, out_irq);
+    if ( res )
+        goto out;
+out:
+    return res;
+}
+
+int dt_irq_translate(const struct dt_raw_irq *raw,
+                     struct dt_irq *out_irq)
+{
+    ASSERT(dt_irq_xlate != NULL);
+
+    /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
+
+    return dt_irq_xlate(raw->specifier, raw->size,
+                        &out_irq->irq, &out_irq->type);
+}
+
+int dt_device_get_irq(const struct dt_device_node *device, int index,
+                      struct dt_irq *out_irq)
+{
+    struct dt_raw_irq raw;
+    int res;
+
+    res = dt_device_get_raw_irq(device, index, &raw);
+
+    if ( res )
+        return res;
+
+    return dt_irq_translate(&raw, out_irq);
+}
+
+/**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
  * @mem: Memory chunk to use for allocating device nodes and properties
@@ -1401,6 +1747,22 @@ static void __init dt_alias_scan(void)
     }
 }
 
+struct dt_device_node * __init dt_find_interrupt_controller(const char *compat)
+{
+    struct dt_device_node *np = NULL;
+
+    while ( (np = dt_find_compatible_node(np, NULL, compat)) )
+    {
+        if ( !dt_find_property(np, "interrupt-controller", NULL) )
+            continue;
+
+        if ( dt_get_parent(np) )
+            break;
+    }
+
+    return np;
+}
+
 void __init dt_unflatten_host_device_tree(void)
 {
     __unflatten_device_tree(device_tree_flattened, &dt_host);
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index cc3a070..a7cfa94 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -99,6 +99,67 @@ struct dt_device_node {
 
 };
 
+/**
+ * IRQ line type.
+ *
+ * DT_IRQ_TYPE_NONE            - default, unspecified type
+ * DT_IRQ_TYPE_EDGE_RISING     - rising edge triggered
+ * DT_IRQ_TYPE_EDGE_FALLING    - falling edge triggered
+ * DT_IRQ_TYPE_EDGE_BOTH       - rising and falling edge triggered
+ * DT_IRQ_TYPE_LEVEL_HIGH      - high level triggered
+ * DT_IRQ_TYPE_LEVEL_LOW       - low level triggered
+ * DT_IRQ_TYPE_LEVEL_MASK      - Mask to filter out the level bits
+ * DT_IRQ_TYPE_SENSE_MASK      - Mask for all the above bits
+ */
+#define DT_IRQ_TYPE_NONE           0x00000000
+#define DT_IRQ_TYPE_EDGE_RISING    0x00000001
+#define DT_IRQ_TYPE_EDGE_FALLING   0x00000002
+#define DT_IRQ_TYPE_EDGE_BOTH                           \
+    (DT_IRQ_TYPE_EDGE_FALLING | DT_IRQ_TYPE_EDGE_RISING)
+#define DT_IRQ_TYPE_LEVEL_HIGH     0x00000004
+#define DT_IRQ_TYPE_LEVEL_LOW      0x00000008
+#define DT_IRQ_TYPE_LEVEL_MASK                          \
+    (DT_IRQ_TYPE_LEVEL_LOW | DT_IRQ_TYPE_LEVEL_HIGH)
+#define DT_IRQ_TYPE_SENSE_MASK     0x0000000f
+
+/**
+ * dt_irq - describe an IRQ in the device tree
+ * @irq: IRQ number
+ * @type: IRQ type (see DT_IRQ_TYPE_*)
+ *
+ * This structure is returned when an interrupt is mapped.
+ */
+struct dt_irq {
+    unsigned int irq;
+    unsigned int type;
+};
+
+/* If type == DT_IRQ_TYPE_NONE, assume we use level triggered */
+static inline bool_t dt_irq_is_level_triggered(const struct dt_irq *irq)
+{
+    unsigned int type = irq->type;
+
+    return (type & DT_IRQ_TYPE_LEVEL_MASK) || (type == DT_IRQ_TYPE_NONE);
+}
+
+/**
+ * dt_raw_irq - container for device_node/irq_specifier for an irq controller
+ * @controller: pointer to interrupt controller deivce tree node
+ * @size: size of interrupt specifier
+ * @specifier: array of cells @size long specifying the specific interrupt
+ *
+ * This structure is returned when an interrupt is mapped but not translated.
+ */
+#define DT_MAX_IRQ_SPEC     4 /* We handle specifiers of at most 4 cells */
+struct dt_raw_irq {
+    const struct dt_device_node *controller;
+    u32 size;
+    u32 specifier[DT_MAX_IRQ_SPEC];
+};
+
+#define dt_irq(irq) ((irq)->irq)
+#define dt_irq_flags(irq) ((irq)->flags)
+
 typedef int (*device_tree_node_func)(const void *fdt,
                                      int node, const char *name, int depth,
                                      u32 address_cells, u32 size_cells,
@@ -136,11 +197,40 @@ void __init device_tree_dump(const void *fdt);
 void __init dt_unflatten_host_device_tree(void);
 
 /**
+ * IRQ translation callback
+ * TODO: For the moment we assume that we only have ONE
+ * interrupt-controller.
+ */
+typedef int (*dt_irq_xlate_func)(const u32 *intspec, unsigned int intsize,
+                                 unsigned int *out_hwirq,
+                                 unsigned int *out_type);
+extern dt_irq_xlate_func dt_irq_xlate;
+
+/**
  * Host device tree
  * DO NOT modify it!
  */
 extern struct dt_device_node *dt_host;
 
+/**
+ * Primary interrupt controller
+ * Exynos SOC has an interrupt combiner, interrupt has no physical
+ * meaning when it's not connected to the primary controller.
+ * We will only map interrupt whose parent controller is
+ * dt_interrupt_controller. It should always be a GIC.
+ * TODO: Handle multiple GIC
+ */
+extern const struct dt_device_node *dt_interrupt_controller;
+
+/**
+ * Find the interrupt controller
+ * For the moment we handle only one interrupt controller: the first
+ * one without parent which is compatible with the string "compat".
+ *
+ * If found, return the interrupt controller device node.
+ */
+struct dt_device_node * __init dt_find_interrupt_controller(const char *compat);
+
 #define dt_node_cmp(s1, s2) strcmp((s1), (s2))
 #define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
 
@@ -285,6 +375,15 @@ int dt_device_get_address(const struct dt_device_node *dev, int index,
                           u64 *addr, u64 *size);
 
 /**
+ * dt_number_of_irq - Get the number of IRQ for a device
+ * @device: the device whose number of interrupt is to be retrieved
+ *
+ * Return the number of irq for this device or 0 if there is no
+ * interrupt or an error occurred.
+ */
+unsigned int dt_number_of_irq(const struct dt_device_node *device);
+
+/**
  * dt_number_of_address - Get the number of addresses for a device
  * @device: the device whose number of address is to be retrieved
  *
@@ -294,6 +393,37 @@ int dt_device_get_address(const struct dt_device_node *dev, int index,
 unsigned int dt_number_of_address(const struct dt_device_node *device);
 
 /**
+ * dt_device_get_irq - Resolve an interrupt for a device
+ * @device: the device whose interrupt is to be resolved
+ * @index: index of the interrupt to resolve
+ * @out_irq: structure dt_irq filled by this function
+ *
+ * This function resolves an interrupt, walking the tree, for a given
+ * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
+ */
+int dt_device_get_irq(const struct dt_device_node *device, int index,
+                      struct dt_irq *irq);
+
+/**
+ * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
+ * @device: the device whose interrupt is to be resolved
+ * @index: index of the interrupt to resolve
+ * @out_irq: structure dt_raw_irq filled by this function
+ *
+ * This function resolves an interrupt for a device, no translation is
+ * made. dt_irq_translate can be called after.
+ */
+int dt_device_get_raw_irq(const struct dt_device_node *device, int index,
+                          struct dt_raw_irq *irq);
+
+/**
+ * dt_irq_translate - Translate an irq
+ * @raw: IRQ to translate (raw format)
+ * @out_irq: structure dt_irq filled by this function
+ */
+int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
+
+/**
  * dt_n_size_cells - Helper to retrieve the number of cell for the size
  * @np: node to get the value
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6MT-0003kj-5m; Tue, 14 May 2013 03:57:13 +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 1Uc6MR-0003kQ-R1
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:12 +0000
Received: from [193.109.254.147:14367] by server-7.bemta-14.messagelabs.com id
	45/08-27745-716B1915; Tue, 14 May 2013 03:57:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368503829!8949839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22031 invoked from network); 14 May 2013 03:57:10 -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;
	14 May 2013 03:57: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 1Uc6MP-0003DO-5P
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6MP-0006Sl-3n
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:09 +0000
Date: Tue, 14 May 2013 03:57:09 +0000
Message-Id: <E1Uc6MP-0006Sl-3n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce gic_route_dt_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 13bd8be39c077d1da3268f67837c0a0353accf89
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:51:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce gic_route_dt_irq
    
    This function routes an IRQ to a specific cpu. The IRQ is retrieved via
    the device tree.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   11 +++++++++++
 xen/include/asm-arm/gic.h |    5 +++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1e2d493..4d79060 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -238,6 +238,17 @@ static int gic_route_irq(unsigned int irq, bool_t level,
     return 0;
 }
 
+/* Program the GIC to route an interrupt with a dt_irq */
+void gic_route_dt_irq(const struct dt_irq *irq, unsigned int cpu_mask,
+                      unsigned int priority)
+{
+    bool_t level;
+
+    level = dt_irq_is_level_triggered(irq);
+
+    gic_route_irq(irq->irq, level, cpu_mask, priority);
+}
+
 static void __init gic_dist_init(void)
 {
     uint32_t type;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 3efb2b5..78dd21a 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -133,6 +133,8 @@
 #define VGIC_IRQ_EVTCHN_CALLBACK 31
 
 #ifndef __ASSEMBLY__
+#include <xen/device_tree.h>
+
 extern int domain_vgic_init(struct domain *d);
 extern void domain_vgic_free(struct domain *d);
 
@@ -142,6 +144,9 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
 extern void vgic_clear_pending_irqs(struct vcpu *v);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
+/* Program the GIC to route an interrupt with a dt_irq */
+extern void gic_route_dt_irq(const struct dt_irq *irq, unsigned int cpu_mask,
+                             unsigned int priority);
 extern void gic_route_ppis(void);
 extern void gic_route_spis(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6MT-0003kj-5m; Tue, 14 May 2013 03:57:13 +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 1Uc6MR-0003kQ-R1
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:12 +0000
Received: from [193.109.254.147:14367] by server-7.bemta-14.messagelabs.com id
	45/08-27745-716B1915; Tue, 14 May 2013 03:57:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368503829!8949839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22031 invoked from network); 14 May 2013 03:57:10 -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;
	14 May 2013 03:57: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 1Uc6MP-0003DO-5P
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6MP-0006Sl-3n
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:09 +0000
Date: Tue, 14 May 2013 03:57:09 +0000
Message-Id: <E1Uc6MP-0006Sl-3n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce gic_route_dt_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 13bd8be39c077d1da3268f67837c0a0353accf89
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:51:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce gic_route_dt_irq
    
    This function routes an IRQ to a specific cpu. The IRQ is retrieved via
    the device tree.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   11 +++++++++++
 xen/include/asm-arm/gic.h |    5 +++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1e2d493..4d79060 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -238,6 +238,17 @@ static int gic_route_irq(unsigned int irq, bool_t level,
     return 0;
 }
 
+/* Program the GIC to route an interrupt with a dt_irq */
+void gic_route_dt_irq(const struct dt_irq *irq, unsigned int cpu_mask,
+                      unsigned int priority)
+{
+    bool_t level;
+
+    level = dt_irq_is_level_triggered(irq);
+
+    gic_route_irq(irq->irq, level, cpu_mask, priority);
+}
+
 static void __init gic_dist_init(void)
 {
     uint32_t type;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 3efb2b5..78dd21a 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -133,6 +133,8 @@
 #define VGIC_IRQ_EVTCHN_CALLBACK 31
 
 #ifndef __ASSEMBLY__
+#include <xen/device_tree.h>
+
 extern int domain_vgic_init(struct domain *d);
 extern void domain_vgic_free(struct domain *d);
 
@@ -142,6 +144,9 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
 extern void vgic_clear_pending_irqs(struct vcpu *v);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
+/* Program the GIC to route an interrupt with a dt_irq */
+extern void gic_route_dt_irq(const struct dt_irq *irq, unsigned int cpu_mask,
+                             unsigned int priority);
 extern void gic_route_ppis(void);
 extern void gic_route_spis(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6Mf-0003nD-8L; Tue, 14 May 2013 03:57: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 1Uc6Me-0003ms-3D
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:24 +0000
Received: from [85.158.138.51:24101] by server-2.bemta-3.messagelabs.com id
	F3/84-07011-126B1915; Tue, 14 May 2013 03:57:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1368503839!32367068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16605 invoked from network); 14 May 2013 03:57:20 -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;
	14 May 2013 03:57: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 1Uc6MZ-0003DX-Di
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6MZ-0006Td-Bu
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:19 +0000
Date: Tue, 14 May 2013 03:57:19 +0000
Message-Id: <E1Uc6MZ-0006Td-Bu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce gic_irq_xlate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cd025772d02d5ff98b5a6141b8a424a305720648
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:58:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce gic_irq_xlate
    
    This function translates an interrupt specifier to an IRQ number and IRQ
    type (ie: level trigger, edge trigger,...). It's GIC specific.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   20 ++++++++++++++++++++
 xen/arch/arm/setup.c      |    1 +
 xen/include/asm-arm/gic.h |    4 ++++
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 4d79060..68f2410 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -329,6 +329,26 @@ static void __cpuinit gic_hyp_disable(void)
     GICH[GICH_HCR] = 0;
 }
 
+int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
+                  unsigned int *out_hwirq,
+                  unsigned int *out_type)
+{
+    if ( intsize < 3 )
+        return -EINVAL;
+
+    /* Get the interrupt number and add 16 to skip over SGIs */
+    *out_hwirq = intspec[1] + 16;
+
+    /* For SPIs, we need to add 16 more to get the GIC irq ID number */
+    if ( !intspec[0] )
+        *out_hwirq += 16;
+
+    if ( out_type )
+        *out_type = intspec[2] & DT_IRQ_TYPE_SENSE_MASK;
+
+    return 0;
+}
+
 /* Set up the GIC */
 void __init gic_init(void)
 {
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 81bc956..fc53117 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -431,6 +431,7 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     vm_init();
     dt_unflatten_host_device_tree();
+    dt_irq_xlate = gic_irq_xlate;
 
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 78dd21a..6ff217c 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -189,6 +189,10 @@ extern void send_SGI_allbutself(enum gic_sgi sgi);
 /* print useful debug info */
 extern void gic_dump_info(struct vcpu *v);
 
+/* IRQ translation function for the device tree */
+int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
+                  unsigned int *out_hwirq, unsigned int *out_type);
+
 #endif /* __ASSEMBLY__ */
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6Mf-0003nD-8L; Tue, 14 May 2013 03:57: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 1Uc6Me-0003ms-3D
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:24 +0000
Received: from [85.158.138.51:24101] by server-2.bemta-3.messagelabs.com id
	F3/84-07011-126B1915; Tue, 14 May 2013 03:57:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1368503839!32367068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16605 invoked from network); 14 May 2013 03:57:20 -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;
	14 May 2013 03:57: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 1Uc6MZ-0003DX-Di
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6MZ-0006Td-Bu
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:19 +0000
Date: Tue, 14 May 2013 03:57:19 +0000
Message-Id: <E1Uc6MZ-0006Td-Bu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce gic_irq_xlate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cd025772d02d5ff98b5a6141b8a424a305720648
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 17:58:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce gic_irq_xlate
    
    This function translates an interrupt specifier to an IRQ number and IRQ
    type (ie: level trigger, edge trigger,...). It's GIC specific.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   20 ++++++++++++++++++++
 xen/arch/arm/setup.c      |    1 +
 xen/include/asm-arm/gic.h |    4 ++++
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 4d79060..68f2410 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -329,6 +329,26 @@ static void __cpuinit gic_hyp_disable(void)
     GICH[GICH_HCR] = 0;
 }
 
+int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
+                  unsigned int *out_hwirq,
+                  unsigned int *out_type)
+{
+    if ( intsize < 3 )
+        return -EINVAL;
+
+    /* Get the interrupt number and add 16 to skip over SGIs */
+    *out_hwirq = intspec[1] + 16;
+
+    /* For SPIs, we need to add 16 more to get the GIC irq ID number */
+    if ( !intspec[0] )
+        *out_hwirq += 16;
+
+    if ( out_type )
+        *out_type = intspec[2] & DT_IRQ_TYPE_SENSE_MASK;
+
+    return 0;
+}
+
 /* Set up the GIC */
 void __init gic_init(void)
 {
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 81bc956..fc53117 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -431,6 +431,7 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     vm_init();
     dt_unflatten_host_device_tree();
+    dt_irq_xlate = gic_irq_xlate;
 
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 78dd21a..6ff217c 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -189,6 +189,10 @@ extern void send_SGI_allbutself(enum gic_sgi sgi);
 /* print useful debug info */
 extern void gic_dump_info(struct vcpu *v);
 
+/* IRQ translation function for the device tree */
+int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
+                  unsigned int *out_hwirq, unsigned int *out_type);
+
 #endif /* __ASSEMBLY__ */
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6Mo-0003pO-BX; Tue, 14 May 2013 03:57:34 +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 1Uc6Mn-0003p1-20
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:33 +0000
Received: from [85.158.143.99:25605] by server-1.bemta-4.messagelabs.com id
	57/7C-06122-C26B1915; Tue, 14 May 2013 03:57:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1368503849!31836185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10290 invoked from network); 14 May 2013 03:57: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;
	14 May 2013 03:57: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 1Uc6Mj-0003Df-JU
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Mj-0006Tz-Hw
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:29 +0000
Date: Tue, 14 May 2013 03:57:29 +0000
Message-Id: <E1Uc6Mj-0006Tz-Hw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce setup_dt_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6f5d777f4c44e2ce73691ddfde3d5531c443690a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:03:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce setup_dt_irq
    
    This function will replace setup_irq in later patch. It takes a dt_irq
    as first argument instead of an unsigned int.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |    5 +++++
 xen/include/asm-arm/irq.h |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 68f2410..1124fc1 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -521,6 +521,11 @@ static int __setup_irq(struct irq_desc *desc, unsigned int irq,
     return 0;
 }
 
+int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
+{
+    return setup_irq(irq->irq, new);
+}
+
 int __init setup_irq(unsigned int irq, struct irqaction *new)
 {
     int rc;
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index eeb733a..de3aa22 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -2,6 +2,7 @@
 #define _ASM_HW_IRQ_H
 
 #include <xen/config.h>
+#include <xen/device_tree.h>
 
 #define NR_VECTORS 256 /* XXX */
 
@@ -26,6 +27,7 @@ struct irq_cfg {
 #define nr_static_irqs NR_IRQS
 
 struct irq_desc;
+struct irqaction;
 
 struct irq_desc *__irq_to_desc(int irq);
 
@@ -38,6 +40,8 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
+int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
+
 #endif /* _ASM_HW_IRQ_H */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6Mo-0003pO-BX; Tue, 14 May 2013 03:57:34 +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 1Uc6Mn-0003p1-20
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:33 +0000
Received: from [85.158.143.99:25605] by server-1.bemta-4.messagelabs.com id
	57/7C-06122-C26B1915; Tue, 14 May 2013 03:57:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1368503849!31836185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10290 invoked from network); 14 May 2013 03:57: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;
	14 May 2013 03:57: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 1Uc6Mj-0003Df-JU
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Mj-0006Tz-Hw
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:29 +0000
Date: Tue, 14 May 2013 03:57:29 +0000
Message-Id: <E1Uc6Mj-0006Tz-Hw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce setup_dt_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6f5d777f4c44e2ce73691ddfde3d5531c443690a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:03:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce setup_dt_irq
    
    This function will replace setup_irq in later patch. It takes a dt_irq
    as first argument instead of an unsigned int.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |    5 +++++
 xen/include/asm-arm/irq.h |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 68f2410..1124fc1 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -521,6 +521,11 @@ static int __setup_irq(struct irq_desc *desc, unsigned int irq,
     return 0;
 }
 
+int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
+{
+    return setup_irq(irq->irq, new);
+}
+
 int __init setup_irq(unsigned int irq, struct irqaction *new)
 {
     int rc;
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index eeb733a..de3aa22 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -2,6 +2,7 @@
 #define _ASM_HW_IRQ_H
 
 #include <xen/config.h>
+#include <xen/device_tree.h>
 
 #define NR_VECTORS 256 /* XXX */
 
@@ -26,6 +27,7 @@ struct irq_cfg {
 #define nr_static_irqs NR_IRQS
 
 struct irq_desc;
+struct irqaction;
 
 struct irq_desc *__irq_to_desc(int irq);
 
@@ -38,6 +40,8 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
+int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
+
 #endif /* _ASM_HW_IRQ_H */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6My-0003ro-Eh; Tue, 14 May 2013 03:57:44 +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 1Uc6Mx-0003rX-Js
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:43 +0000
Received: from [85.158.139.211:15108] by server-4.bemta-5.messagelabs.com id
	5C/64-12332-636B1915; Tue, 14 May 2013 03:57:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1368503859!22940174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14945 invoked from network); 14 May 2013 03:57:41 -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;
	14 May 2013 03:57: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 1Uc6Mt-0003Dl-PA
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Mt-0006UP-OA
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:39 +0000
Date: Tue, 14 May 2013 03:57:39 +0000
Message-Id: <E1Uc6Mt-0006UP-OA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce request_dt_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a55acb35cbef4ea50f91fb05915e3934754ad4de
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:04:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce request_dt_irq
    
    This function will replace request_irq in a later patch. It takes a dt_irq
    as first argument instead of an unsigned int.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c        |    7 +++++++
 xen/include/asm-arm/irq.h |    4 ++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index b2e486f..e83ad22 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -93,6 +93,13 @@ void __cpuinit init_secondary_IRQ(void)
     BUG_ON(init_local_irq_data() < 0);
 }
 
+int __init request_dt_irq(const struct dt_irq *irq,
+        void (*handler)(int, void *, struct cpu_user_regs *),
+        unsigned long irqflags, const char *devname, void *dev_id)
+{
+    return request_irq(irq->irq, handler, irqflags, devname, dev_id);
+}
+
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char * devname, void *dev_id)
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index de3aa22..80ff68d 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -40,6 +40,10 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
+int __init request_dt_irq(const struct dt_irq *irq,
+                          void (*handler)(int, void *, struct cpu_user_regs *),
+                          unsigned long irqflags, const char *devname,
+                          void *dev_id);
 int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
 
 #endif /* _ASM_HW_IRQ_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6My-0003ro-Eh; Tue, 14 May 2013 03:57:44 +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 1Uc6Mx-0003rX-Js
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:43 +0000
Received: from [85.158.139.211:15108] by server-4.bemta-5.messagelabs.com id
	5C/64-12332-636B1915; Tue, 14 May 2013 03:57:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1368503859!22940174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14945 invoked from network); 14 May 2013 03:57:41 -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;
	14 May 2013 03:57: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 1Uc6Mt-0003Dl-PA
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Mt-0006UP-OA
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:39 +0000
Date: Tue, 14 May 2013 03:57:39 +0000
Message-Id: <E1Uc6Mt-0006UP-OA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce request_dt_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a55acb35cbef4ea50f91fb05915e3934754ad4de
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:04:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Introduce request_dt_irq
    
    This function will replace request_irq in a later patch. It takes a dt_irq
    as first argument instead of an unsigned int.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c        |    7 +++++++
 xen/include/asm-arm/irq.h |    4 ++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index b2e486f..e83ad22 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -93,6 +93,13 @@ void __cpuinit init_secondary_IRQ(void)
     BUG_ON(init_local_irq_data() < 0);
 }
 
+int __init request_dt_irq(const struct dt_irq *irq,
+        void (*handler)(int, void *, struct cpu_user_regs *),
+        unsigned long irqflags, const char *devname, void *dev_id)
+{
+    return request_irq(irq->irq, handler, irqflags, devname, dev_id);
+}
+
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char * devname, void *dev_id)
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index de3aa22..80ff68d 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -40,6 +40,10 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
+int __init request_dt_irq(const struct dt_irq *irq,
+                          void (*handler)(int, void *, struct cpu_user_regs *),
+                          unsigned long irqflags, const char *devname,
+                          void *dev_id);
 int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
 
 #endif /* _ASM_HW_IRQ_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6N7-0003to-HU; Tue, 14 May 2013 03:57: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 1Uc6N6-0003tZ-ND
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:53 +0000
Received: from [193.109.254.147:32263] by server-5.bemta-14.messagelabs.com id
	9F/76-18535-046B1915; Tue, 14 May 2013 03:57:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368503870!8949875!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23043 invoked from network); 14 May 2013 03:57:51 -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;
	14 May 2013 03:57: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 1Uc6N3-0003Dr-UY
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6N3-0006Ul-TT
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:49 +0000
Date: Tue, 14 May 2013 03:57:49 +0000
Message-Id: <E1Uc6N3-0006Ul-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use hierarchical device tree
	to retrieve GIC 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 71fa862f21e7097c479095274e87e846ce8e29c7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 19:14:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Use hierarchical device tree to retrieve GIC information
    
    - Remove early parsing for GIC addresses
    - Remove hard coded maintenance IRQ number
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c            |   63 +++++++++++++++++++++++++++++-----------
 xen/common/device_tree.c      |   42 ---------------------------
 xen/include/xen/device_tree.h |    8 -----
 3 files changed, 45 insertions(+), 68 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1124fc1..5781a2e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -45,6 +45,7 @@ static struct {
     paddr_t hbase;       /* Address of virtual interface registers */
     paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;  /* Number of interrupts (SPIs + PPIs + SGIs) */
+    struct dt_irq maintenance; /* IRQ maintenance */
     unsigned int cpus;
     spinlock_t lock;
 } gic;
@@ -352,28 +353,53 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
 /* Set up the GIC */
 void __init gic_init(void)
 {
+    struct dt_device_node *node;
+    int res;
+
+    node = dt_find_interrupt_controller("arm,cortex-a15-gic");
+    if ( !node )
+        panic("Unable to find compatible GIC in the device tree\n");
+
+    dt_device_set_used_by(node, DOMID_XEN);
+
+    res = dt_device_get_address(node, 0, &gic.dbase, NULL);
+    if ( res || !gic.dbase || (gic.dbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the distributor\n");
+
+    res = dt_device_get_address(node, 1, &gic.cbase, NULL);
+    if ( res || !gic.cbase || (gic.cbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the CPU\n");
+
+    res = dt_device_get_address(node, 2, &gic.hbase, NULL);
+    if ( res || !gic.hbase || (gic.hbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the hypervisor\n");
+
+    res = dt_device_get_address(node, 3, &gic.vbase, NULL);
+    if ( res || !gic.vbase || (gic.vbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the virtual CPU\n");
+
+    res = dt_device_get_irq(node, 0, &gic.maintenance);
+    if ( res )
+        panic("GIC: Cannot find the maintenance IRQ\n");
+
+    /* Set the GIC as the primary interrupt controller */
+    dt_interrupt_controller = node;
+
+    /* TODO: Add check on distributor, cpu size */
+
     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) )
+              "        gic_vcpu_addr=%"PRIpaddr"\n"
+              "        gic_maintenance_irq=%u\n",
+              gic.dbase, gic.cbase, gic.hbase, gic.vbase,
+              gic.maintenance.irq);
+
+    if ( (gic.dbase & ~PAGE_MASK) || (gic.cbase & ~PAGE_MASK) ||
+         (gic.hbase & ~PAGE_MASK) || (gic.vbase & ~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);
@@ -464,7 +490,7 @@ void gic_route_ppis(void)
 {
     /* XXX should get these from DT */
     /* GIC maintenance */
-    gic_route_irq(25, 1, 1u << smp_processor_id(), 0xa0);
+    gic_route_dt_irq(&gic.maintenance, 1u << smp_processor_id(), 0xa0);
     /* Hypervisor Timer */
     gic_route_irq(26, 1, 1u << smp_processor_id(), 0xa0);
     /* Virtual Timer */
@@ -852,7 +878,8 @@ void gic_dump_info(struct vcpu *v)
 
 void __cpuinit init_maintenance_interrupt(void)
 {
-    request_irq(25, maintenance_interrupt, 0, "irq-maintenance", NULL);
+    request_dt_irq(&gic.maintenance, maintenance_interrupt,
+                   0, "irq-maintenance", NULL);
 }
 
 /*
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 7f632b9..84d704d 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -434,46 +434,6 @@ static void __init process_cpu_node(const void *fdt, int node,
     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 void __init process_multiboot_node(const void *fdt, int node,
                                           const char *name,
                                           u32 address_cells, u32 size_cells)
@@ -525,8 +485,6 @@ static int __init early_scan_node(const void *fdt,
         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);
     else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) )
         process_multiboot_node(fdt, node, name, address_cells, size_cells);
 
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index a7cfa94..5a2a5c6 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -31,13 +31,6 @@ 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_mb_module {
     paddr_t start;
     paddr_t size;
@@ -52,7 +45,6 @@ struct dt_module_info {
 
 struct dt_early_info {
     struct dt_mem_info mem;
-    struct dt_gic_info gic;
     struct dt_module_info modules;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:57:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:57: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 1Uc6N7-0003to-HU; Tue, 14 May 2013 03:57: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 1Uc6N6-0003tZ-ND
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:53 +0000
Received: from [193.109.254.147:32263] by server-5.bemta-14.messagelabs.com id
	9F/76-18535-046B1915; Tue, 14 May 2013 03:57:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368503870!8949875!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23043 invoked from network); 14 May 2013 03:57:51 -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;
	14 May 2013 03:57: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 1Uc6N3-0003Dr-UY
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6N3-0006Ul-TT
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:57:49 +0000
Date: Tue, 14 May 2013 03:57:49 +0000
Message-Id: <E1Uc6N3-0006Ul-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use hierarchical device tree
	to retrieve GIC 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 71fa862f21e7097c479095274e87e846ce8e29c7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 19:14:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Use hierarchical device tree to retrieve GIC information
    
    - Remove early parsing for GIC addresses
    - Remove hard coded maintenance IRQ number
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c            |   63 +++++++++++++++++++++++++++++-----------
 xen/common/device_tree.c      |   42 ---------------------------
 xen/include/xen/device_tree.h |    8 -----
 3 files changed, 45 insertions(+), 68 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1124fc1..5781a2e 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -45,6 +45,7 @@ static struct {
     paddr_t hbase;       /* Address of virtual interface registers */
     paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;  /* Number of interrupts (SPIs + PPIs + SGIs) */
+    struct dt_irq maintenance; /* IRQ maintenance */
     unsigned int cpus;
     spinlock_t lock;
 } gic;
@@ -352,28 +353,53 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
 /* Set up the GIC */
 void __init gic_init(void)
 {
+    struct dt_device_node *node;
+    int res;
+
+    node = dt_find_interrupt_controller("arm,cortex-a15-gic");
+    if ( !node )
+        panic("Unable to find compatible GIC in the device tree\n");
+
+    dt_device_set_used_by(node, DOMID_XEN);
+
+    res = dt_device_get_address(node, 0, &gic.dbase, NULL);
+    if ( res || !gic.dbase || (gic.dbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the distributor\n");
+
+    res = dt_device_get_address(node, 1, &gic.cbase, NULL);
+    if ( res || !gic.cbase || (gic.cbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the CPU\n");
+
+    res = dt_device_get_address(node, 2, &gic.hbase, NULL);
+    if ( res || !gic.hbase || (gic.hbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the hypervisor\n");
+
+    res = dt_device_get_address(node, 3, &gic.vbase, NULL);
+    if ( res || !gic.vbase || (gic.vbase & ~PAGE_MASK) )
+        panic("GIC: Cannot find a valid address for the virtual CPU\n");
+
+    res = dt_device_get_irq(node, 0, &gic.maintenance);
+    if ( res )
+        panic("GIC: Cannot find the maintenance IRQ\n");
+
+    /* Set the GIC as the primary interrupt controller */
+    dt_interrupt_controller = node;
+
+    /* TODO: Add check on distributor, cpu size */
+
     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) )
+              "        gic_vcpu_addr=%"PRIpaddr"\n"
+              "        gic_maintenance_irq=%u\n",
+              gic.dbase, gic.cbase, gic.hbase, gic.vbase,
+              gic.maintenance.irq);
+
+    if ( (gic.dbase & ~PAGE_MASK) || (gic.cbase & ~PAGE_MASK) ||
+         (gic.hbase & ~PAGE_MASK) || (gic.vbase & ~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);
@@ -464,7 +490,7 @@ void gic_route_ppis(void)
 {
     /* XXX should get these from DT */
     /* GIC maintenance */
-    gic_route_irq(25, 1, 1u << smp_processor_id(), 0xa0);
+    gic_route_dt_irq(&gic.maintenance, 1u << smp_processor_id(), 0xa0);
     /* Hypervisor Timer */
     gic_route_irq(26, 1, 1u << smp_processor_id(), 0xa0);
     /* Virtual Timer */
@@ -852,7 +878,8 @@ void gic_dump_info(struct vcpu *v)
 
 void __cpuinit init_maintenance_interrupt(void)
 {
-    request_irq(25, maintenance_interrupt, 0, "irq-maintenance", NULL);
+    request_dt_irq(&gic.maintenance, maintenance_interrupt,
+                   0, "irq-maintenance", NULL);
 }
 
 /*
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 7f632b9..84d704d 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -434,46 +434,6 @@ static void __init process_cpu_node(const void *fdt, int node,
     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 void __init process_multiboot_node(const void *fdt, int node,
                                           const char *name,
                                           u32 address_cells, u32 size_cells)
@@ -525,8 +485,6 @@ static int __init early_scan_node(const void *fdt,
         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);
     else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) )
         process_multiboot_node(fdt, node, name, address_cells, size_cells);
 
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index a7cfa94..5a2a5c6 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -31,13 +31,6 @@ 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_mb_module {
     paddr_t start;
     paddr_t size;
@@ -52,7 +45,6 @@ struct dt_module_info {
 
 struct dt_early_info {
     struct dt_mem_info mem;
-    struct dt_gic_info gic;
     struct dt_module_info modules;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6NJ-0003wV-Kr; Tue, 14 May 2013 03:58: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 1Uc6NI-0003vs-6Q
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:04 +0000
Received: from [85.158.137.99:54126] by server-1.bemta-3.messagelabs.com id
	C4/C7-20211-A46B1915; Tue, 14 May 2013 03:58:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1368503880!18358933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18433 invoked from network); 14 May 2013 03:58:01 -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;
	14 May 2013 03:58: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 1Uc6NE-0003E0-4G
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6NE-0006V8-2C
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:00 +0000
Date: Tue, 14 May 2013 03:58:00 +0000
Message-Id: <E1Uc6NE-0006V8-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Retrieve timer interrupts
	from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f5bde3da40ea79cbd4a1ab4de28e46e338bf7486
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 19:45:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Retrieve timer interrupts from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c         |    9 +-----
 xen/arch/arm/time.c        |   53 +++++++++++++++++++++++++++++++++++++++-----
 xen/include/asm-arm/time.h |   12 ++++++++++
 3 files changed, 61 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5781a2e..f69f86a 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -488,15 +488,10 @@ void gic_disable_cpu(void)
 
 void gic_route_ppis(void)
 {
-    /* XXX should get these from DT */
     /* GIC maintenance */
     gic_route_dt_irq(&gic.maintenance, 1u << smp_processor_id(), 0xa0);
-    /* Hypervisor Timer */
-    gic_route_irq(26, 1, 1u << smp_processor_id(), 0xa0);
-    /* Virtual Timer */
-    gic_route_irq(27, 1, 1u << smp_processor_id(), 0xa0);
-    /* Physical Timer */
-    gic_route_irq(30, 1, 1u << smp_processor_id(), 0xa0);
+    /* Route timer interrupt */
+    route_timer_interrupt();
 }
 
 void gic_route_spis(void)
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 82f69d2..ecb7626 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -19,6 +19,7 @@
 
 #include <xen/config.h>
 #include <xen/console.h>
+#include <xen/device_tree.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
@@ -46,6 +47,8 @@ uint64_t __read_mostly boot_count;
  * register-mapped time source in the SoC. */
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 
+static struct dt_irq timer_irq[MAX_TIMER_PPI];
+
 /*static inline*/ s_time_t ticks_to_ns(uint64_t ticks)
 {
     return muldiv64(ticks, SECONDS(1), 1000 * cpu_khz);
@@ -90,6 +93,29 @@ static uint32_t calibrate_timer(void)
 /* Set up the timer on the boot CPU */
 int __init init_xen_time(void)
 {
+    struct dt_device_node *dev;
+    int res;
+    unsigned int i;
+
+    dev = dt_find_compatible_node(NULL, NULL, "arm,armv7-timer");
+    if ( !dev )
+        panic("Unable to find a compatible timer in the device tree\n");
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    /* Retrieve all IRQs for the timer */
+    for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ )
+    {
+        res = dt_device_get_irq(dev, i, &timer_irq[i]);
+        if ( res )
+            panic("Timer: Unable to retrieve IRQ %u from the device tree\n", i);
+    }
+
+    printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
+           timer_irq[TIMER_PHYS_NONSECURE_PPI].irq,
+           timer_irq[TIMER_HYP_PPI].irq,
+           timer_irq[TIMER_VIRT_PPI].irq);
+
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
         panic("CPU does not support the Generic Timer v1 interface.\n");
@@ -143,7 +169,8 @@ int reprogram_timer(s_time_t timeout)
 /* Handle the firing timer */
 static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    if ( irq == 26 && READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING )
+    if ( irq == (timer_irq[TIMER_HYP_PPI].irq) &&
+         READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
         raise_softirq(TIMER_SOFTIRQ);
@@ -151,7 +178,8 @@ static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
         WRITE_SYSREG32(0, CNTHP_CTL_EL2);
     }
 
-    if (irq == 30 && READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING )
+    if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI].irq) &&
+         READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
         raise_softirq(TIMER_SOFTIRQ);
@@ -167,6 +195,17 @@ static void vtimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
     vgic_vcpu_inject_irq(current, irq, 1);
 }
 
+/* Route timer's IRQ on this CPU */
+void __cpuinit route_timer_interrupt(void)
+{
+    gic_route_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI],
+                     1u << smp_processor_id(), 0xa0);
+    gic_route_dt_irq(&timer_irq[TIMER_HYP_PPI],
+                     1u << smp_processor_id(), 0xa0);
+    gic_route_dt_irq(&timer_irq[TIMER_VIRT_PPI],
+                     1u << smp_processor_id(), 0xa0);
+}
+
 /* Set up the timer interrupt on this CPU */
 void __cpuinit init_timer_interrupt(void)
 {
@@ -184,10 +223,12 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    /* XXX Need to find this IRQ number from devicetree? */
-    request_irq(26, timer_interrupt, 0, "hyptimer", NULL);
-    request_irq(27, vtimer_interrupt, 0, "virtimer", NULL);
-    request_irq(30, timer_interrupt, 0, "phytimer", NULL);
+    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt, 0,
+                   "hyptimer", NULL);
+    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt, 0,
+                   "virtimer", NULL);
+    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt, 0,
+                   "phytimer", NULL);
 }
 
 /* Wait a set number of microseconds */
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index c16bf08..05833ce 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -11,6 +11,18 @@ static inline cycles_t get_cycles (void)
 struct tm;
 struct tm wallclock_time(void);
 
+/* List of timer's IRQ */
+enum timer_ppi
+{
+    TIMER_PHYS_SECURE_PPI = 0,
+    TIMER_PHYS_NONSECURE_PPI = 1,
+    TIMER_VIRT_PPI = 2,
+    TIMER_HYP_PPI = 3,
+    MAX_TIMER_PPI = 4,
+};
+
+/* Route timer's IRQ on this CPU */
+extern void __cpuinit route_timer_interrupt(void);
 
 /* Set up the timer interrupt on this CPU */
 extern void __cpuinit init_timer_interrupt(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6NJ-0003wV-Kr; Tue, 14 May 2013 03:58: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 1Uc6NI-0003vs-6Q
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:04 +0000
Received: from [85.158.137.99:54126] by server-1.bemta-3.messagelabs.com id
	C4/C7-20211-A46B1915; Tue, 14 May 2013 03:58:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1368503880!18358933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18433 invoked from network); 14 May 2013 03:58:01 -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;
	14 May 2013 03:58: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 1Uc6NE-0003E0-4G
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6NE-0006V8-2C
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:00 +0000
Date: Tue, 14 May 2013 03:58:00 +0000
Message-Id: <E1Uc6NE-0006V8-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Retrieve timer interrupts
	from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 f5bde3da40ea79cbd4a1ab4de28e46e338bf7486
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 19:45:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:58 2013 +0100

    xen/arm: Retrieve timer interrupts from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c         |    9 +-----
 xen/arch/arm/time.c        |   53 +++++++++++++++++++++++++++++++++++++++-----
 xen/include/asm-arm/time.h |   12 ++++++++++
 3 files changed, 61 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5781a2e..f69f86a 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -488,15 +488,10 @@ void gic_disable_cpu(void)
 
 void gic_route_ppis(void)
 {
-    /* XXX should get these from DT */
     /* GIC maintenance */
     gic_route_dt_irq(&gic.maintenance, 1u << smp_processor_id(), 0xa0);
-    /* Hypervisor Timer */
-    gic_route_irq(26, 1, 1u << smp_processor_id(), 0xa0);
-    /* Virtual Timer */
-    gic_route_irq(27, 1, 1u << smp_processor_id(), 0xa0);
-    /* Physical Timer */
-    gic_route_irq(30, 1, 1u << smp_processor_id(), 0xa0);
+    /* Route timer interrupt */
+    route_timer_interrupt();
 }
 
 void gic_route_spis(void)
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 82f69d2..ecb7626 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -19,6 +19,7 @@
 
 #include <xen/config.h>
 #include <xen/console.h>
+#include <xen/device_tree.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
@@ -46,6 +47,8 @@ uint64_t __read_mostly boot_count;
  * register-mapped time source in the SoC. */
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 
+static struct dt_irq timer_irq[MAX_TIMER_PPI];
+
 /*static inline*/ s_time_t ticks_to_ns(uint64_t ticks)
 {
     return muldiv64(ticks, SECONDS(1), 1000 * cpu_khz);
@@ -90,6 +93,29 @@ static uint32_t calibrate_timer(void)
 /* Set up the timer on the boot CPU */
 int __init init_xen_time(void)
 {
+    struct dt_device_node *dev;
+    int res;
+    unsigned int i;
+
+    dev = dt_find_compatible_node(NULL, NULL, "arm,armv7-timer");
+    if ( !dev )
+        panic("Unable to find a compatible timer in the device tree\n");
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    /* Retrieve all IRQs for the timer */
+    for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ )
+    {
+        res = dt_device_get_irq(dev, i, &timer_irq[i]);
+        if ( res )
+            panic("Timer: Unable to retrieve IRQ %u from the device tree\n", i);
+    }
+
+    printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
+           timer_irq[TIMER_PHYS_NONSECURE_PPI].irq,
+           timer_irq[TIMER_HYP_PPI].irq,
+           timer_irq[TIMER_VIRT_PPI].irq);
+
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
         panic("CPU does not support the Generic Timer v1 interface.\n");
@@ -143,7 +169,8 @@ int reprogram_timer(s_time_t timeout)
 /* Handle the firing timer */
 static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    if ( irq == 26 && READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING )
+    if ( irq == (timer_irq[TIMER_HYP_PPI].irq) &&
+         READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
         raise_softirq(TIMER_SOFTIRQ);
@@ -151,7 +178,8 @@ static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
         WRITE_SYSREG32(0, CNTHP_CTL_EL2);
     }
 
-    if (irq == 30 && READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING )
+    if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI].irq) &&
+         READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
         raise_softirq(TIMER_SOFTIRQ);
@@ -167,6 +195,17 @@ static void vtimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
     vgic_vcpu_inject_irq(current, irq, 1);
 }
 
+/* Route timer's IRQ on this CPU */
+void __cpuinit route_timer_interrupt(void)
+{
+    gic_route_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI],
+                     1u << smp_processor_id(), 0xa0);
+    gic_route_dt_irq(&timer_irq[TIMER_HYP_PPI],
+                     1u << smp_processor_id(), 0xa0);
+    gic_route_dt_irq(&timer_irq[TIMER_VIRT_PPI],
+                     1u << smp_processor_id(), 0xa0);
+}
+
 /* Set up the timer interrupt on this CPU */
 void __cpuinit init_timer_interrupt(void)
 {
@@ -184,10 +223,12 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    /* XXX Need to find this IRQ number from devicetree? */
-    request_irq(26, timer_interrupt, 0, "hyptimer", NULL);
-    request_irq(27, vtimer_interrupt, 0, "virtimer", NULL);
-    request_irq(30, timer_interrupt, 0, "phytimer", NULL);
+    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt, 0,
+                   "hyptimer", NULL);
+    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt, 0,
+                   "virtimer", NULL);
+    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt, 0,
+                   "phytimer", NULL);
 }
 
 /* Wait a set number of microseconds */
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index c16bf08..05833ce 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -11,6 +11,18 @@ static inline cycles_t get_cycles (void)
 struct tm;
 struct tm wallclock_time(void);
 
+/* List of timer's IRQ */
+enum timer_ppi
+{
+    TIMER_PHYS_SECURE_PPI = 0,
+    TIMER_PHYS_NONSECURE_PPI = 1,
+    TIMER_VIRT_PPI = 2,
+    TIMER_HYP_PPI = 3,
+    MAX_TIMER_PPI = 4,
+};
+
+/* Route timer's IRQ on this CPU */
+extern void __cpuinit route_timer_interrupt(void);
 
 /* Set up the timer interrupt on this CPU */
 extern void __cpuinit init_timer_interrupt(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6NS-0003zI-QK; Tue, 14 May 2013 03:58:14 +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 1Uc6NR-0003yh-C6
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:13 +0000
Received: from [85.158.137.99:52147] by server-5.bemta-3.messagelabs.com id
	F5/69-29713-456B1915; Tue, 14 May 2013 03:58:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1368503890!16023787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1877 invoked from network); 14 May 2013 03:58:11 -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;
	14 May 2013 03:58: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 1Uc6NO-0003EZ-Ch
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6NO-0006WG-9i
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:10 +0000
Date: Tue, 14 May 2013 03:58:10 +0000
Message-Id: <E1Uc6NO-0006WG-9i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't hardcode VGIC
	informations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 699f48cd134f6cf92375f0b00fcb67cffc8f40b4
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 19:53:17 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Don't hardcode VGIC informations
    
    - Define VGIC base address per domain. For the moment the base addresses
    to dom0 base addresses.
    - The number of interrupt lines (ie number of SPIs) is equal to:
        * 0 for guests
        * number of host SPIs for dom0
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |   21 ++++++++++++++++++---
 xen/arch/arm/vgic.c          |   20 ++++++++++++++------
 xen/include/asm-arm/domain.h |    5 ++++-
 xen/include/asm-arm/gic.h    |    3 +++
 4 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index f69f86a..821f683 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -56,6 +56,11 @@ static DEFINE_PER_CPU(uint64_t, lr_mask);
 
 static unsigned nr_lrs;
 
+unsigned int gic_number_lines(void)
+{
+    return gic.lines;
+}
+
 irq_desc_t *__irq_to_desc(int irq)
 {
     if (irq < NR_LOCAL_IRQS) return &this_cpu(local_irq_desc)[irq];
@@ -775,11 +780,21 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
 
 int gicv_setup(struct domain *d)
 {
+    /* TODO: Retrieve distributor and CPU guest base address from the
+     * guest DTS
+     * For the moment we use dom0 DTS
+     */
+    d->arch.vgic.dbase = gic.dbase;
+    d->arch.vgic.cbase = gic.cbase;
+
+
+    d->arch.vgic.nr_lines = 0;
+
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, gic.cbase,
-                        gic.cbase + (2 * PAGE_SIZE) - 1,
-                        gic.vbase);
+    return map_mmio_regions(d, d->arch.vgic.cbase,
+                            d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
+                            gic.vbase);
 }
 
 static void gic_irq_eoi(void *info)
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index f9c1a6b..7eaccb7 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -30,8 +30,6 @@
 #include "io.h"
 #include <asm/gic.h>
 
-#define VGIC_DISTR_BASE_ADDRESS 0x000000002c001000
-
 #define REG(n) (n/4)
 
 /* Number of ranks of interrupt registers for a domain */
@@ -80,7 +78,15 @@ int domain_vgic_init(struct domain *d)
     int i;
 
     d->arch.vgic.ctlr = 0;
-    d->arch.vgic.nr_lines = 32;
+
+    /* Currently nr_lines in vgic and gic doesn't have the same meanings
+     * Here nr_lines = number of SPIs
+     */
+    if ( d->domain_id == 0 )
+        d->arch.vgic.nr_lines = gic_number_lines() - 32;
+    else
+        d->arch.vgic.nr_lines = 0; /* We don't need SPIs for the guest */
+
     d->arch.vgic.shared_irqs =
         xmalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));
     d->arch.vgic.pending_irqs =
@@ -163,7 +169,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
-    int offset = (int)(info->gpa - VGIC_DISTR_BASE_ADDRESS);
+    int offset = (int)(info->gpa - v->domain->arch.vgic.dbase);
     int gicd_reg = REG(offset);
 
     switch ( gicd_reg )
@@ -440,7 +446,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
-    int offset = (int)(info->gpa - VGIC_DISTR_BASE_ADDRESS);
+    int offset = (int)(info->gpa - v->domain->arch.vgic.dbase);
     int gicd_reg = REG(offset);
     uint32_t tr;
 
@@ -620,7 +626,9 @@ write_ignore:
 
 static int vgic_distr_mmio_check(struct vcpu *v, paddr_t addr)
 {
-    return addr >= VGIC_DISTR_BASE_ADDRESS && addr < (VGIC_DISTR_BASE_ADDRESS+PAGE_SIZE);
+    struct domain *d = v->domain;
+
+    return (addr >= (d->arch.vgic.dbase)) && (addr < (d->arch.vgic.dbase + PAGE_SIZE));
 }
 
 const struct mmio_handler vgic_distr_mmio_handler = {
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index cca7416..cb251cc 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -88,13 +88,16 @@ struct arch_domain
          */
         spinlock_t lock;
         int ctlr;
-        int nr_lines;
+        int nr_lines; /* Number of SPIs */
         struct vgic_irq_rank *shared_irqs;
         /*
          * SPIs are domain global, SGIs and PPIs are per-VCPU and stored in
          * struct arch_vcpu.
          */
         struct pending_irq *pending_irqs;
+        /* Base address for guest GIC */
+        paddr_t dbase; /* Distributor base address */
+        paddr_t cbase; /* CPU base address */
     } vgic;
 
     struct vpl011 {
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 6ff217c..e7608dc 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -189,6 +189,9 @@ extern void send_SGI_allbutself(enum gic_sgi sgi);
 /* print useful debug info */
 extern void gic_dump_info(struct vcpu *v);
 
+/* Number of interrupt lines */
+extern unsigned int gic_number_lines(void);
+
 /* IRQ translation function for the device tree */
 int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
                   unsigned int *out_hwirq, unsigned int *out_type);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6NS-0003zI-QK; Tue, 14 May 2013 03:58:14 +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 1Uc6NR-0003yh-C6
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:13 +0000
Received: from [85.158.137.99:52147] by server-5.bemta-3.messagelabs.com id
	F5/69-29713-456B1915; Tue, 14 May 2013 03:58:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1368503890!16023787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1877 invoked from network); 14 May 2013 03:58:11 -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;
	14 May 2013 03:58: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 1Uc6NO-0003EZ-Ch
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6NO-0006WG-9i
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:10 +0000
Date: Tue, 14 May 2013 03:58:10 +0000
Message-Id: <E1Uc6NO-0006WG-9i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't hardcode VGIC
	informations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 699f48cd134f6cf92375f0b00fcb67cffc8f40b4
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 19:53:17 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Don't hardcode VGIC informations
    
    - Define VGIC base address per domain. For the moment the base addresses
    to dom0 base addresses.
    - The number of interrupt lines (ie number of SPIs) is equal to:
        * 0 for guests
        * number of host SPIs for dom0
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |   21 ++++++++++++++++++---
 xen/arch/arm/vgic.c          |   20 ++++++++++++++------
 xen/include/asm-arm/domain.h |    5 ++++-
 xen/include/asm-arm/gic.h    |    3 +++
 4 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index f69f86a..821f683 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -56,6 +56,11 @@ static DEFINE_PER_CPU(uint64_t, lr_mask);
 
 static unsigned nr_lrs;
 
+unsigned int gic_number_lines(void)
+{
+    return gic.lines;
+}
+
 irq_desc_t *__irq_to_desc(int irq)
 {
     if (irq < NR_LOCAL_IRQS) return &this_cpu(local_irq_desc)[irq];
@@ -775,11 +780,21 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
 
 int gicv_setup(struct domain *d)
 {
+    /* TODO: Retrieve distributor and CPU guest base address from the
+     * guest DTS
+     * For the moment we use dom0 DTS
+     */
+    d->arch.vgic.dbase = gic.dbase;
+    d->arch.vgic.cbase = gic.cbase;
+
+
+    d->arch.vgic.nr_lines = 0;
+
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, gic.cbase,
-                        gic.cbase + (2 * PAGE_SIZE) - 1,
-                        gic.vbase);
+    return map_mmio_regions(d, d->arch.vgic.cbase,
+                            d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
+                            gic.vbase);
 }
 
 static void gic_irq_eoi(void *info)
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index f9c1a6b..7eaccb7 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -30,8 +30,6 @@
 #include "io.h"
 #include <asm/gic.h>
 
-#define VGIC_DISTR_BASE_ADDRESS 0x000000002c001000
-
 #define REG(n) (n/4)
 
 /* Number of ranks of interrupt registers for a domain */
@@ -80,7 +78,15 @@ int domain_vgic_init(struct domain *d)
     int i;
 
     d->arch.vgic.ctlr = 0;
-    d->arch.vgic.nr_lines = 32;
+
+    /* Currently nr_lines in vgic and gic doesn't have the same meanings
+     * Here nr_lines = number of SPIs
+     */
+    if ( d->domain_id == 0 )
+        d->arch.vgic.nr_lines = gic_number_lines() - 32;
+    else
+        d->arch.vgic.nr_lines = 0; /* We don't need SPIs for the guest */
+
     d->arch.vgic.shared_irqs =
         xmalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));
     d->arch.vgic.pending_irqs =
@@ -163,7 +169,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
-    int offset = (int)(info->gpa - VGIC_DISTR_BASE_ADDRESS);
+    int offset = (int)(info->gpa - v->domain->arch.vgic.dbase);
     int gicd_reg = REG(offset);
 
     switch ( gicd_reg )
@@ -440,7 +446,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
-    int offset = (int)(info->gpa - VGIC_DISTR_BASE_ADDRESS);
+    int offset = (int)(info->gpa - v->domain->arch.vgic.dbase);
     int gicd_reg = REG(offset);
     uint32_t tr;
 
@@ -620,7 +626,9 @@ write_ignore:
 
 static int vgic_distr_mmio_check(struct vcpu *v, paddr_t addr)
 {
-    return addr >= VGIC_DISTR_BASE_ADDRESS && addr < (VGIC_DISTR_BASE_ADDRESS+PAGE_SIZE);
+    struct domain *d = v->domain;
+
+    return (addr >= (d->arch.vgic.dbase)) && (addr < (d->arch.vgic.dbase + PAGE_SIZE));
 }
 
 const struct mmio_handler vgic_distr_mmio_handler = {
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index cca7416..cb251cc 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -88,13 +88,16 @@ struct arch_domain
          */
         spinlock_t lock;
         int ctlr;
-        int nr_lines;
+        int nr_lines; /* Number of SPIs */
         struct vgic_irq_rank *shared_irqs;
         /*
          * SPIs are domain global, SGIs and PPIs are per-VCPU and stored in
          * struct arch_vcpu.
          */
         struct pending_irq *pending_irqs;
+        /* Base address for guest GIC */
+        paddr_t dbase; /* Distributor base address */
+        paddr_t cbase; /* CPU base address */
     } vgic;
 
     struct vpl011 {
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 6ff217c..e7608dc 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -189,6 +189,9 @@ extern void send_SGI_allbutself(enum gic_sgi sgi);
 /* print useful debug info */
 extern void gic_dump_info(struct vcpu *v);
 
+/* Number of interrupt lines */
+extern unsigned int gic_number_lines(void);
+
 /* IRQ translation function for the device tree */
 int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
                   unsigned int *out_hwirq, unsigned int *out_type);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6Nc-00041E-TA; Tue, 14 May 2013 03:58:24 +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 1Uc6Nb-00040t-Fu
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:23 +0000
Received: from [85.158.138.51:25411] by server-12.bemta-3.messagelabs.com id
	38/0A-17342-E56B1915; Tue, 14 May 2013 03:58:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1368503900!29616684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4658 invoked from network); 14 May 2013 03:58:21 -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;
	14 May 2013 03:58:21 -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 1Uc6NY-0003Ef-IH
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6NY-0006Wc-Gw
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:20 +0000
Date: Tue, 14 May 2013 03:58:20 +0000
Message-Id: <E1Uc6NY-0006Wc-Gw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't hardcode virtual timer
	IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 95edff23232dbc94761d7e956669723ffb5c69bc
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 9 18:11:02 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Don't hardcode virtual timer IRQs
    
    Define virtual timer IRQs per VCPU
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/time.c        |    9 ++++++++-
 xen/arch/arm/vtimer.c      |   13 ++++++++-----
 xen/include/asm-arm/time.h |    3 +++
 3 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index ecb7626..2e928bc 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -49,6 +49,13 @@ unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 
 static struct dt_irq timer_irq[MAX_TIMER_PPI];
 
+const struct dt_irq *timer_dt_irq(enum timer_ppi ppi)
+{
+    ASSERT(ppi >= TIMER_PHYS_SECURE_PPI && ppi < MAX_TIMER_PPI);
+
+    return &timer_irq[ppi];
+}
+
 /*static inline*/ s_time_t ticks_to_ns(uint64_t ticks)
 {
     return muldiv64(ticks, SECONDS(1), 1000 * cpu_khz);
@@ -192,7 +199,7 @@ static void vtimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
     current->arch.virt_timer.ctl = READ_SYSREG32(CNTV_CTL_EL0);
     WRITE_SYSREG32(current->arch.virt_timer.ctl | CNTx_CTL_MASK, CNTV_CTL_EL0);
-    vgic_vcpu_inject_irq(current, irq, 1);
+    vgic_vcpu_inject_irq(current, current->arch.virt_timer.irq, 1);
 }
 
 /* Route timer's IRQ on this CPU */
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 6993425..aee762a 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -34,14 +34,14 @@ static void phys_timer_expired(void *data)
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_PENDING;
     if ( !(t->ctl & CNTx_CTL_MASK) )
-        vgic_vcpu_inject_irq(t->v, 30, 1);
+        vgic_vcpu_inject_irq(t->v, t->irq, 1);
 }
 
 static void virt_timer_expired(void *data)
 {
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_MASK;
-    vgic_vcpu_inject_irq(t->v, 27, 1);
+    vgic_vcpu_inject_irq(t->v, t->irq, 1);
 }
 
 int vcpu_domain_init(struct domain *d)
@@ -55,17 +55,20 @@ int vcpu_vtimer_init(struct vcpu *v)
 {
     struct vtimer *t = &v->arch.phys_timer;
 
+    /* TODO: Retrieve physical and virtual timer IRQ from the guest
+     * DT. For the moment we use dom0 DT
+     */
+
     init_timer(&t->timer, phys_timer_expired, t, v->processor);
     t->ctl = 0;
     t->cval = NOW();
-    t->irq = 30;
+    t->irq = timer_dt_irq(TIMER_PHYS_NONSECURE_PPI)->irq;
     t->v = v;
 
     t = &v->arch.virt_timer;
     init_timer(&t->timer, virt_timer_expired, t, v->processor);
     t->ctl = 0;
-    t->cval = 0;
-    t->irq = 27;
+    t->irq = timer_dt_irq(TIMER_VIRT_PPI)->irq;
     t->v = v;
 
     return 0;
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index 05833ce..f7aa868 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -21,6 +21,9 @@ enum timer_ppi
     MAX_TIMER_PPI = 4,
 };
 
+/* Get one of the timer IRQ description */
+const struct dt_irq* timer_dt_irq(enum timer_ppi ppi);
+
 /* Route timer's IRQ on this CPU */
 extern void __cpuinit route_timer_interrupt(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6Nc-00041E-TA; Tue, 14 May 2013 03:58:24 +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 1Uc6Nb-00040t-Fu
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:23 +0000
Received: from [85.158.138.51:25411] by server-12.bemta-3.messagelabs.com id
	38/0A-17342-E56B1915; Tue, 14 May 2013 03:58:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1368503900!29616684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4658 invoked from network); 14 May 2013 03:58:21 -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;
	14 May 2013 03:58:21 -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 1Uc6NY-0003Ef-IH
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6NY-0006Wc-Gw
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:20 +0000
Date: Tue, 14 May 2013 03:58:20 +0000
Message-Id: <E1Uc6NY-0006Wc-Gw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't hardcode virtual timer
	IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 95edff23232dbc94761d7e956669723ffb5c69bc
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 9 18:11:02 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Don't hardcode virtual timer IRQs
    
    Define virtual timer IRQs per VCPU
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/time.c        |    9 ++++++++-
 xen/arch/arm/vtimer.c      |   13 ++++++++-----
 xen/include/asm-arm/time.h |    3 +++
 3 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index ecb7626..2e928bc 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -49,6 +49,13 @@ unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 
 static struct dt_irq timer_irq[MAX_TIMER_PPI];
 
+const struct dt_irq *timer_dt_irq(enum timer_ppi ppi)
+{
+    ASSERT(ppi >= TIMER_PHYS_SECURE_PPI && ppi < MAX_TIMER_PPI);
+
+    return &timer_irq[ppi];
+}
+
 /*static inline*/ s_time_t ticks_to_ns(uint64_t ticks)
 {
     return muldiv64(ticks, SECONDS(1), 1000 * cpu_khz);
@@ -192,7 +199,7 @@ static void vtimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
     current->arch.virt_timer.ctl = READ_SYSREG32(CNTV_CTL_EL0);
     WRITE_SYSREG32(current->arch.virt_timer.ctl | CNTx_CTL_MASK, CNTV_CTL_EL0);
-    vgic_vcpu_inject_irq(current, irq, 1);
+    vgic_vcpu_inject_irq(current, current->arch.virt_timer.irq, 1);
 }
 
 /* Route timer's IRQ on this CPU */
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 6993425..aee762a 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -34,14 +34,14 @@ static void phys_timer_expired(void *data)
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_PENDING;
     if ( !(t->ctl & CNTx_CTL_MASK) )
-        vgic_vcpu_inject_irq(t->v, 30, 1);
+        vgic_vcpu_inject_irq(t->v, t->irq, 1);
 }
 
 static void virt_timer_expired(void *data)
 {
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_MASK;
-    vgic_vcpu_inject_irq(t->v, 27, 1);
+    vgic_vcpu_inject_irq(t->v, t->irq, 1);
 }
 
 int vcpu_domain_init(struct domain *d)
@@ -55,17 +55,20 @@ int vcpu_vtimer_init(struct vcpu *v)
 {
     struct vtimer *t = &v->arch.phys_timer;
 
+    /* TODO: Retrieve physical and virtual timer IRQ from the guest
+     * DT. For the moment we use dom0 DT
+     */
+
     init_timer(&t->timer, phys_timer_expired, t, v->processor);
     t->ctl = 0;
     t->cval = NOW();
-    t->irq = 30;
+    t->irq = timer_dt_irq(TIMER_PHYS_NONSECURE_PPI)->irq;
     t->v = v;
 
     t = &v->arch.virt_timer;
     init_timer(&t->timer, virt_timer_expired, t, v->processor);
     t->ctl = 0;
-    t->cval = 0;
-    t->irq = 27;
+    t->irq = timer_dt_irq(TIMER_VIRT_PPI)->irq;
     t->v = v;
 
     return 0;
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index 05833ce..f7aa868 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -21,6 +21,9 @@ enum timer_ppi
     MAX_TIMER_PPI = 4,
 };
 
+/* Get one of the timer IRQ description */
+const struct dt_irq* timer_dt_irq(enum timer_ppi ppi);
+
 /* Route timer's IRQ on this CPU */
 extern void __cpuinit route_timer_interrupt(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6Nm-00044A-W6; Tue, 14 May 2013 03:58:34 +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 1Uc6Nm-000443-4e
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:34 +0000
Received: from [193.109.254.147:51129] by server-15.bemta-14.messagelabs.com
	id A5/7A-16548-966B1915; Tue, 14 May 2013 03:58:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1368503910!9159311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13358 invoked from network); 14 May 2013 03:58:31 -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;
	14 May 2013 03:58: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 1Uc6Ni-0003En-Mj
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Ni-0006X2-Lf
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:30 +0000
Date: Tue, 14 May 2013 03:58:30 +0000
Message-Id: <E1Uc6Ni-0006X2-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce a generic way to
	use a device from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 23045cfe5099a0ff211b31b69073d907f2f221fd
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 20:14:50 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Introduce a generic way to use a device from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile        |    1 +
 xen/arch/arm/device.c        |   74 ++++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/xen.lds.S       |    7 ++++
 xen/include/asm-arm/device.h |   52 +++++++++++++++++++++++++++++
 4 files changed, 134 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 8f75044..4955a21 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -28,6 +28,7 @@ obj-y += vgic.o
 obj-y += vtimer.o
 obj-y += vpl011.o
 obj-y += hvm.o
+obj-y += device.o
 
 #obj-bin-y += ....o
 
diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
new file mode 100644
index 0000000..dc751a9
--- /dev/null
+++ b/xen/arch/arm/device.c
@@ -0,0 +1,74 @@
+/*
+ * xen/arch/arm/device.c
+ *
+ * Helpers to use a device retrieved via the device tree.
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (C) 2013 Linaro Limited.
+ *
+ * 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/device.h>
+#include <xen/errno.h>
+#include <xen/lib.h>
+
+extern const struct device_desc _sdevice[], _edevice[];
+
+static bool_t __init device_is_compatible(const struct device_desc *desc,
+                                          const struct dt_device_node *dev)
+{
+    const char *const *compat;
+
+    if ( !desc->compatible )
+        return 0;
+
+    for ( compat = desc->compatible; *compat; compat++ )
+    {
+        if ( dt_device_is_compatible(dev, *compat) )
+            return 1;
+    }
+
+    return 0;
+}
+
+int __init device_init(struct dt_device_node *dev, enum device_type type,
+                       const void *data)
+{
+    const struct device_desc *desc;
+
+    ASSERT(dev != NULL);
+
+    for ( desc = _sdevice; desc != _edevice; desc++ )
+    {
+        if ( desc->type != type )
+            continue;
+
+        if ( device_is_compatible(desc, dev) )
+        {
+            ASSERT(desc->init != NULL);
+
+            return desc->init(dev, data);
+        }
+
+    }
+
+    return -EBADF;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index fd755d7..deab040 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -76,6 +76,13 @@ SECTIONS
   __lock_profile_end = .;
 #endif
 
+  . = ALIGN(8);
+  .dev.info : {
+      _sdevice = .;
+      *(.dev.info)
+      _edevice = .;
+  } :text
+
   . = ALIGN(PAGE_SIZE);             /* Init code and data */
   __init_begin = .;
   .init.text : {
diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h
new file mode 100644
index 0000000..9e47ca6
--- /dev/null
+++ b/xen/include/asm-arm/device.h
@@ -0,0 +1,52 @@
+#ifndef __ASM_ARM_DEVICE_H
+#define __ASM_ARM_DEVICE_H
+
+#include <xen/init.h>
+#include <xen/device_tree.h>
+
+enum device_type
+{
+    DEVICE_SERIAL
+};
+
+struct device_desc {
+    /* Device name */
+    const char *name;
+    /* Device type */
+    enum device_type type;
+    /* Array of device tree 'compatible' strings */
+    const char *const *compatible;
+    /* Device initialization */
+    int (*init)(struct dt_device_node *dev, const void *data);
+};
+
+/**
+ *  device_init - Initialize a device
+ *  @dev: device to initialize
+ *  @type: type of the device (serial, network...)
+ *  @data: specific data for initializing the device
+ *
+ *  Return 0 on success.
+ */
+int __init device_init(struct dt_device_node *dev, enum device_type type,
+                       const void *data);
+
+#define DT_DEVICE_START(_name, _namestr, _type)                     \
+static const struct device_desc __dev_desc_##_name __used           \
+__attribute__((__section__(".dev.info"))) = {                       \
+    .name = _namestr,                                               \
+    .type = _type,                                                  \
+
+#define DT_DEVICE_END                                               \
+};
+
+#endif /* __ASM_ARM_DEVICE_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6Nm-00044A-W6; Tue, 14 May 2013 03:58:34 +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 1Uc6Nm-000443-4e
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:34 +0000
Received: from [193.109.254.147:51129] by server-15.bemta-14.messagelabs.com
	id A5/7A-16548-966B1915; Tue, 14 May 2013 03:58:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1368503910!9159311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13358 invoked from network); 14 May 2013 03:58:31 -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;
	14 May 2013 03:58: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 1Uc6Ni-0003En-Mj
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Ni-0006X2-Lf
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:30 +0000
Date: Tue, 14 May 2013 03:58:30 +0000
Message-Id: <E1Uc6Ni-0006X2-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce a generic way to
	use a device from the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 23045cfe5099a0ff211b31b69073d907f2f221fd
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 20:14:50 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Introduce a generic way to use a device from the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile        |    1 +
 xen/arch/arm/device.c        |   74 ++++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/xen.lds.S       |    7 ++++
 xen/include/asm-arm/device.h |   52 +++++++++++++++++++++++++++++
 4 files changed, 134 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 8f75044..4955a21 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -28,6 +28,7 @@ obj-y += vgic.o
 obj-y += vtimer.o
 obj-y += vpl011.o
 obj-y += hvm.o
+obj-y += device.o
 
 #obj-bin-y += ....o
 
diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
new file mode 100644
index 0000000..dc751a9
--- /dev/null
+++ b/xen/arch/arm/device.c
@@ -0,0 +1,74 @@
+/*
+ * xen/arch/arm/device.c
+ *
+ * Helpers to use a device retrieved via the device tree.
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (C) 2013 Linaro Limited.
+ *
+ * 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/device.h>
+#include <xen/errno.h>
+#include <xen/lib.h>
+
+extern const struct device_desc _sdevice[], _edevice[];
+
+static bool_t __init device_is_compatible(const struct device_desc *desc,
+                                          const struct dt_device_node *dev)
+{
+    const char *const *compat;
+
+    if ( !desc->compatible )
+        return 0;
+
+    for ( compat = desc->compatible; *compat; compat++ )
+    {
+        if ( dt_device_is_compatible(dev, *compat) )
+            return 1;
+    }
+
+    return 0;
+}
+
+int __init device_init(struct dt_device_node *dev, enum device_type type,
+                       const void *data)
+{
+    const struct device_desc *desc;
+
+    ASSERT(dev != NULL);
+
+    for ( desc = _sdevice; desc != _edevice; desc++ )
+    {
+        if ( desc->type != type )
+            continue;
+
+        if ( device_is_compatible(desc, dev) )
+        {
+            ASSERT(desc->init != NULL);
+
+            return desc->init(dev, data);
+        }
+
+    }
+
+    return -EBADF;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index fd755d7..deab040 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -76,6 +76,13 @@ SECTIONS
   __lock_profile_end = .;
 #endif
 
+  . = ALIGN(8);
+  .dev.info : {
+      _sdevice = .;
+      *(.dev.info)
+      _edevice = .;
+  } :text
+
   . = ALIGN(PAGE_SIZE);             /* Init code and data */
   __init_begin = .;
   .init.text : {
diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h
new file mode 100644
index 0000000..9e47ca6
--- /dev/null
+++ b/xen/include/asm-arm/device.h
@@ -0,0 +1,52 @@
+#ifndef __ASM_ARM_DEVICE_H
+#define __ASM_ARM_DEVICE_H
+
+#include <xen/init.h>
+#include <xen/device_tree.h>
+
+enum device_type
+{
+    DEVICE_SERIAL
+};
+
+struct device_desc {
+    /* Device name */
+    const char *name;
+    /* Device type */
+    enum device_type type;
+    /* Array of device tree 'compatible' strings */
+    const char *const *compatible;
+    /* Device initialization */
+    int (*init)(struct dt_device_node *dev, const void *data);
+};
+
+/**
+ *  device_init - Initialize a device
+ *  @dev: device to initialize
+ *  @type: type of the device (serial, network...)
+ *  @data: specific data for initializing the device
+ *
+ *  Return 0 on success.
+ */
+int __init device_init(struct dt_device_node *dev, enum device_type type,
+                       const void *data);
+
+#define DT_DEVICE_START(_name, _namestr, _type)                     \
+static const struct device_desc __dev_desc_##_name __used           \
+__attribute__((__section__(".dev.info"))) = {                       \
+    .name = _namestr,                                               \
+    .type = _type,                                                  \
+
+#define DT_DEVICE_END                                               \
+};
+
+#endif /* __ASM_ARM_DEVICE_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6Nx-00045z-2p; Tue, 14 May 2013 03:58:45 +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 1Uc6Nv-00045i-Er
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:43 +0000
Received: from [85.158.143.99:29275] by server-2.bemta-4.messagelabs.com id
	63/BD-27124-276B1915; Tue, 14 May 2013 03:58:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1368503921!31908208!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4339 invoked from network); 14 May 2013 03:58:42 -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;
	14 May 2013 03:58: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 1Uc6Ns-0003Et-SU
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Ns-0006XU-Qc
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:40 +0000
Date: Tue, 14 May 2013 03:58:40 +0000
Message-Id: <E1Uc6Ns-0006XU-Qc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: New callback in uart_driver
	to get device tree interrupt structure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2be37b2cda31fc1b5f11deb912249bc54803f055
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 20:36:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: New callback in uart_driver to get device tree interrupt structure
    
    The existing function serial_irq doesn't allow to retrieve if the interrupt
    is edge or level trigger.
    
    Use this function to routes IRQs for all serial ports which Xen is using
    to Xen.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   12 ++++++++++++
 xen/drivers/char/serial.c |   10 ++++++++++
 xen/include/xen/serial.h  |    5 +++++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 821f683..761f570 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -24,6 +24,7 @@
 #include <xen/irq.h>
 #include <xen/sched.h>
 #include <xen/errno.h>
+#include <xen/serial.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
 #include <xen/device_tree.h>
@@ -501,9 +502,20 @@ void gic_route_ppis(void)
 
 void gic_route_spis(void)
 {
+    int seridx;
+    const struct dt_irq *irq;
+
     /* XXX should get these from DT */
     /* UART */
     gic_route_irq(37, 0, 1u << smp_processor_id(), 0xa0);
+
+    for ( seridx = 0; seridx <= SERHND_IDX; seridx++ )
+    {
+        if ( (irq = serial_dt_irq(seridx)) == NULL )
+            continue;
+
+        gic_route_dt_irq(irq, 1u << smp_processor_id(), 0xa0);
+    }
 }
 
 void __init release_irq(unsigned int irq)
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index a3d2b26..0ae7e4d 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -482,6 +482,16 @@ int __init serial_irq(int idx)
     return -1;
 }
 
+const struct dt_irq __init *serial_dt_irq(int idx)
+{
+    if ( (idx >= 0) && (idx < ARRAY_SIZE(com)) &&
+         com[idx].driver && com[idx].driver->dt_irq_get )
+        return com[idx].driver->dt_irq_get(&com[idx]);
+
+    return NULL;
+}
+
+
 void serial_suspend(void)
 {
     int i;
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index b932ed4..5de5171 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -71,6 +71,8 @@ struct uart_driver {
     int  (*getc)(struct serial_port *, char *);
     /* Get IRQ number for this port's serial line: returns -1 if none. */
     int  (*irq)(struct serial_port *);
+    /* Get IRQ device node for this port's serial line: returns NULL if none. */
+    const struct dt_irq *(*dt_irq_get)(struct serial_port *);
 };
 
 /* 'Serial handles' are composed from the following fields. */
@@ -120,6 +122,9 @@ void serial_end_log_everything(int handle);
 /* Return irq number for specified serial port (identified by index). */
 int serial_irq(int idx);
 
+/* Return irq device node for specified serial port (identified by index). */
+const struct dt_irq *serial_dt_irq(int idx);
+
 /* Serial suspend/resume. */
 void serial_suspend(void);
 void serial_resume(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03: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 1Uc6Nx-00045z-2p; Tue, 14 May 2013 03:58:45 +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 1Uc6Nv-00045i-Er
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:43 +0000
Received: from [85.158.143.99:29275] by server-2.bemta-4.messagelabs.com id
	63/BD-27124-276B1915; Tue, 14 May 2013 03:58:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1368503921!31908208!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4339 invoked from network); 14 May 2013 03:58:42 -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;
	14 May 2013 03:58: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 1Uc6Ns-0003Et-SU
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Ns-0006XU-Qc
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:40 +0000
Date: Tue, 14 May 2013 03:58:40 +0000
Message-Id: <E1Uc6Ns-0006XU-Qc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: New callback in uart_driver
	to get device tree interrupt structure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2be37b2cda31fc1b5f11deb912249bc54803f055
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 20:36:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: New callback in uart_driver to get device tree interrupt structure
    
    The existing function serial_irq doesn't allow to retrieve if the interrupt
    is edge or level trigger.
    
    Use this function to routes IRQs for all serial ports which Xen is using
    to Xen.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   12 ++++++++++++
 xen/drivers/char/serial.c |   10 ++++++++++
 xen/include/xen/serial.h  |    5 +++++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 821f683..761f570 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -24,6 +24,7 @@
 #include <xen/irq.h>
 #include <xen/sched.h>
 #include <xen/errno.h>
+#include <xen/serial.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
 #include <xen/device_tree.h>
@@ -501,9 +502,20 @@ void gic_route_ppis(void)
 
 void gic_route_spis(void)
 {
+    int seridx;
+    const struct dt_irq *irq;
+
     /* XXX should get these from DT */
     /* UART */
     gic_route_irq(37, 0, 1u << smp_processor_id(), 0xa0);
+
+    for ( seridx = 0; seridx <= SERHND_IDX; seridx++ )
+    {
+        if ( (irq = serial_dt_irq(seridx)) == NULL )
+            continue;
+
+        gic_route_dt_irq(irq, 1u << smp_processor_id(), 0xa0);
+    }
 }
 
 void __init release_irq(unsigned int irq)
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index a3d2b26..0ae7e4d 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -482,6 +482,16 @@ int __init serial_irq(int idx)
     return -1;
 }
 
+const struct dt_irq __init *serial_dt_irq(int idx)
+{
+    if ( (idx >= 0) && (idx < ARRAY_SIZE(com)) &&
+         com[idx].driver && com[idx].driver->dt_irq_get )
+        return com[idx].driver->dt_irq_get(&com[idx]);
+
+    return NULL;
+}
+
+
 void serial_suspend(void)
 {
     int i;
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index b932ed4..5de5171 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -71,6 +71,8 @@ struct uart_driver {
     int  (*getc)(struct serial_port *, char *);
     /* Get IRQ number for this port's serial line: returns -1 if none. */
     int  (*irq)(struct serial_port *);
+    /* Get IRQ device node for this port's serial line: returns NULL if none. */
+    const struct dt_irq *(*dt_irq_get)(struct serial_port *);
 };
 
 /* 'Serial handles' are composed from the following fields. */
@@ -120,6 +122,9 @@ void serial_end_log_everything(int handle);
 /* Return irq number for specified serial port (identified by index). */
 int serial_irq(int idx);
 
+/* Return irq device node for specified serial port (identified by index). */
+const struct dt_irq *serial_dt_irq(int idx);
+
 /* Serial suspend/resume. */
 void serial_suspend(void);
 void serial_resume(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6O8-00047z-5u; Tue, 14 May 2013 03:58:56 +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 1Uc6O6-00047c-AL
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:54 +0000
Received: from [85.158.138.51:8184] by server-3.bemta-3.messagelabs.com id
	D1/2F-28331-D76B1915; Tue, 14 May 2013 03:58:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1368503931!32708855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31350 invoked from network); 14 May 2013 03:58:52 -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;
	14 May 2013 03:58: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 1Uc6O3-0003Ez-2e
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6O3-0006Xq-1C
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:51 +0000
Date: Tue, 14 May 2013 03:58:51 +0000
Message-Id: <E1Uc6O3-0006Xq-1C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add generic UART to get the
	device in the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2a403a18dd34050d9439ce78576fca5f5d03d69d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 21:02:04 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Add generic UART to get the device in the device tree
    
    This generic UART will find the right UART via xen command line
    with dtuart=myserial.
    
    "myserial" is the alias of the UART in the device tree. Xen will retrieve
    the information via the device tree and call the initialization function for
    this specific UART thanks to the device API.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/setup.c         |    3 +-
 xen/drivers/char/Makefile    |    1 +
 xen/drivers/char/dt-uart.c   |   69 ++++++++++++++++++++++++++++++++++++++++++
 xen/drivers/char/serial.c    |    6 ++++
 xen/include/asm-arm/config.h |    2 +-
 xen/include/xen/serial.h     |    5 ++-
 6 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index fc53117..2e331d3 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -436,8 +436,9 @@ void __init start_xen(unsigned long boot_phys_offset,
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
     pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
-    console_init_preirq();
 #endif
+    dt_uart_init();
+    console_init_preirq();
 
     system_state = SYS_STATE_boot;
 
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index ab2246d..9c067f9 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -2,4 +2,5 @@ obj-y += console.o
 obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
 obj-$(HAS_EHCI) += ehci-dbgp.o
+obj-$(CONFIG_ARM) += dt-uart.o
 obj-y += serial.o
diff --git a/xen/drivers/char/dt-uart.c b/xen/drivers/char/dt-uart.c
new file mode 100644
index 0000000..93bb0f5
--- /dev/null
+++ b/xen/drivers/char/dt-uart.c
@@ -0,0 +1,69 @@
+/*
+ * xen/drivers/char/dt-uart.c
+ *
+ * Generic uart retrieved via the device tree
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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/device.h>
+#include <asm/early_printk.h>
+#include <asm/types.h>
+#include <xen/console.h>
+#include <xen/device_tree.h>
+#include <xen/serial.h>
+
+/*
+ * Configure UART port with a string:
+ * alias,options
+ *
+ * @alias: alias used in the device tree for the UART
+ * @options: UART speficic options (see in each UART driver)
+ */
+static char __initdata opt_dtuart[30] = "";
+string_param("dtuart", opt_dtuart);
+
+void __init dt_uart_init(void)
+{
+    struct dt_device_node *dev;
+    int ret;
+    const char *devalias = opt_dtuart;
+    char *options;
+
+    if ( !console_has("dtuart") || !strcmp(opt_dtuart, "") )
+    {
+        early_printk("No console\n");
+        return;
+    }
+
+    options = strchr(opt_dtuart, ',');
+    if ( options != NULL )
+        *(options++) = '\0';
+    else
+        options = "";
+
+    early_printk("Looking for UART console %s\n", devalias);
+    dev = dt_find_node_by_alias(devalias);
+
+    if ( !dev )
+    {
+        early_printk("Unable to find device \"%s\"\n", devalias);
+        return;
+    }
+
+    ret = device_init(dev, DEVICE_SERIAL, options);
+
+    if ( ret )
+        early_printk("Unable to initialize serial: %d\n", ret);
+}
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index 0ae7e4d..e1c3f47 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -271,6 +271,12 @@ int __init serial_parse_handle(char *conf)
         goto common;
     }
 
+    if ( !strncmp(conf, "dtuart", 5) )
+    {
+        handle = SERHND_DTUART;
+        goto common;
+    }
+
     if ( strncmp(conf, "com", 3) )
         goto fail;
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 98a3a43..8ed72f5 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -39,7 +39,7 @@
 
 #define CONFIG_VIDEO 1
 
-#define OPT_CONSOLE_STR "com1"
+#define OPT_CONSOLE_STR "dtuart"
 
 #ifdef MAX_PHYS_CPUS
 #define NR_CPUS MAX_PHYS_CPUS
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 5de5171..8af3bc4 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -9,6 +9,7 @@
 #ifndef __XEN_SERIAL_H__
 #define __XEN_SERIAL_H__
 
+#include <xen/init.h>
 #include <xen/spinlock.h>
 
 struct cpu_user_regs;
@@ -76,10 +77,11 @@ struct uart_driver {
 };
 
 /* 'Serial handles' are composed from the following fields. */
-#define SERHND_IDX      (3<<0) /* COM1, COM2, or DBGP?                    */
+#define SERHND_IDX      (3<<0) /* COM1, COM2, DBGP, DTUART?               */
 # define SERHND_COM1    (0<<0)
 # define SERHND_COM2    (1<<0)
 # define SERHND_DBGP    (2<<0)
+# define SERHND_DTUART  (0<<0) /* Steal SERHND_COM1 value */
 #define SERHND_HI       (1<<2) /* Mux/demux each transferred char by MSB. */
 #define SERHND_LO       (1<<3) /* Ditto, except that the MSB is cleared.  */
 #define SERHND_COOKED   (1<<4) /* Newline/carriage-return translation?    */
@@ -156,6 +158,7 @@ void ns16550_init(int index, struct ns16550_defaults *defaults);
 void ehci_dbgp_init(void);
 
 void pl011_init(int index, unsigned long register_base_address);
+void __init dt_uart_init(void);
 
 struct physdev_dbgp_op;
 int dbgp_op(const struct physdev_dbgp_op *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:58:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:58: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 1Uc6O8-00047z-5u; Tue, 14 May 2013 03:58:56 +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 1Uc6O6-00047c-AL
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:54 +0000
Received: from [85.158.138.51:8184] by server-3.bemta-3.messagelabs.com id
	D1/2F-28331-D76B1915; Tue, 14 May 2013 03:58:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1368503931!32708855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31350 invoked from network); 14 May 2013 03:58:52 -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;
	14 May 2013 03:58: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 1Uc6O3-0003Ez-2e
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6O3-0006Xq-1C
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:58:51 +0000
Date: Tue, 14 May 2013 03:58:51 +0000
Message-Id: <E1Uc6O3-0006Xq-1C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add generic UART to get the
	device in the device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2a403a18dd34050d9439ce78576fca5f5d03d69d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 21:02:04 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 11:59:59 2013 +0100

    xen/arm: Add generic UART to get the device in the device tree
    
    This generic UART will find the right UART via xen command line
    with dtuart=myserial.
    
    "myserial" is the alias of the UART in the device tree. Xen will retrieve
    the information via the device tree and call the initialization function for
    this specific UART thanks to the device API.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/setup.c         |    3 +-
 xen/drivers/char/Makefile    |    1 +
 xen/drivers/char/dt-uart.c   |   69 ++++++++++++++++++++++++++++++++++++++++++
 xen/drivers/char/serial.c    |    6 ++++
 xen/include/asm-arm/config.h |    2 +-
 xen/include/xen/serial.h     |    5 ++-
 6 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index fc53117..2e331d3 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -436,8 +436,9 @@ void __init start_xen(unsigned long boot_phys_offset,
 #ifdef EARLY_UART_ADDRESS
     /* TODO Need to get device tree or command line for UART address */
     pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
-    console_init_preirq();
 #endif
+    dt_uart_init();
+    console_init_preirq();
 
     system_state = SYS_STATE_boot;
 
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index ab2246d..9c067f9 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -2,4 +2,5 @@ obj-y += console.o
 obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
 obj-$(HAS_EHCI) += ehci-dbgp.o
+obj-$(CONFIG_ARM) += dt-uart.o
 obj-y += serial.o
diff --git a/xen/drivers/char/dt-uart.c b/xen/drivers/char/dt-uart.c
new file mode 100644
index 0000000..93bb0f5
--- /dev/null
+++ b/xen/drivers/char/dt-uart.c
@@ -0,0 +1,69 @@
+/*
+ * xen/drivers/char/dt-uart.c
+ *
+ * Generic uart retrieved via the device tree
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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/device.h>
+#include <asm/early_printk.h>
+#include <asm/types.h>
+#include <xen/console.h>
+#include <xen/device_tree.h>
+#include <xen/serial.h>
+
+/*
+ * Configure UART port with a string:
+ * alias,options
+ *
+ * @alias: alias used in the device tree for the UART
+ * @options: UART speficic options (see in each UART driver)
+ */
+static char __initdata opt_dtuart[30] = "";
+string_param("dtuart", opt_dtuart);
+
+void __init dt_uart_init(void)
+{
+    struct dt_device_node *dev;
+    int ret;
+    const char *devalias = opt_dtuart;
+    char *options;
+
+    if ( !console_has("dtuart") || !strcmp(opt_dtuart, "") )
+    {
+        early_printk("No console\n");
+        return;
+    }
+
+    options = strchr(opt_dtuart, ',');
+    if ( options != NULL )
+        *(options++) = '\0';
+    else
+        options = "";
+
+    early_printk("Looking for UART console %s\n", devalias);
+    dev = dt_find_node_by_alias(devalias);
+
+    if ( !dev )
+    {
+        early_printk("Unable to find device \"%s\"\n", devalias);
+        return;
+    }
+
+    ret = device_init(dev, DEVICE_SERIAL, options);
+
+    if ( ret )
+        early_printk("Unable to initialize serial: %d\n", ret);
+}
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index 0ae7e4d..e1c3f47 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -271,6 +271,12 @@ int __init serial_parse_handle(char *conf)
         goto common;
     }
 
+    if ( !strncmp(conf, "dtuart", 5) )
+    {
+        handle = SERHND_DTUART;
+        goto common;
+    }
+
     if ( strncmp(conf, "com", 3) )
         goto fail;
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 98a3a43..8ed72f5 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -39,7 +39,7 @@
 
 #define CONFIG_VIDEO 1
 
-#define OPT_CONSOLE_STR "com1"
+#define OPT_CONSOLE_STR "dtuart"
 
 #ifdef MAX_PHYS_CPUS
 #define NR_CPUS MAX_PHYS_CPUS
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 5de5171..8af3bc4 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -9,6 +9,7 @@
 #ifndef __XEN_SERIAL_H__
 #define __XEN_SERIAL_H__
 
+#include <xen/init.h>
 #include <xen/spinlock.h>
 
 struct cpu_user_regs;
@@ -76,10 +77,11 @@ struct uart_driver {
 };
 
 /* 'Serial handles' are composed from the following fields. */
-#define SERHND_IDX      (3<<0) /* COM1, COM2, or DBGP?                    */
+#define SERHND_IDX      (3<<0) /* COM1, COM2, DBGP, DTUART?               */
 # define SERHND_COM1    (0<<0)
 # define SERHND_COM2    (1<<0)
 # define SERHND_DBGP    (2<<0)
+# define SERHND_DTUART  (0<<0) /* Steal SERHND_COM1 value */
 #define SERHND_HI       (1<<2) /* Mux/demux each transferred char by MSB. */
 #define SERHND_LO       (1<<3) /* Ditto, except that the MSB is cleared.  */
 #define SERHND_COOKED   (1<<4) /* Newline/carriage-return translation?    */
@@ -156,6 +158,7 @@ void ns16550_init(int index, struct ns16550_defaults *defaults);
 void ehci_dbgp_init(void);
 
 void pl011_init(int index, unsigned long register_base_address);
+void __init dt_uart_init(void);
 
 struct physdev_dbgp_op;
 int dbgp_op(const struct physdev_dbgp_op *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6OH-0004A4-Lo; Tue, 14 May 2013 03: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 1Uc6OG-00049j-Ci
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:04 +0000
Received: from [85.158.137.99:56026] by server-2.bemta-3.messagelabs.com id
	5F/25-07011-786B1915; Tue, 14 May 2013 03:59:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1368503941!16314097!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26887 invoked from network); 14 May 2013 03:59:02 -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;
	14 May 2013 03:59:02 -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 1Uc6OD-0003Fb-92
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6OD-0006YD-6L
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:01 +0000
Date: Tue, 14 May 2013 03:59:01 +0000
Message-Id: <E1Uc6OD-0006YD-6L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use device tree API in pl011
	UART driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3baf9f2371f1627f186dba7a2d6db51f39745ce5
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 21:52:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Use device tree API in pl011 UART driver
    
    Allow UART driver to retrieve all its information in the device tree.
    It's possible to choose the pl011 driver via the Xen command line.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c       |    4 --
 xen/arch/arm/setup.c     |    4 --
 xen/drivers/char/pl011.c |   88 +++++++++++++++++++++++++++++++++++++--------
 xen/include/xen/serial.h |    1 -
 4 files changed, 72 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 761f570..648b1a0 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -505,10 +505,6 @@ void gic_route_spis(void)
     int seridx;
     const struct dt_irq *irq;
 
-    /* XXX should get these from DT */
-    /* UART */
-    gic_route_irq(37, 0, 1u << smp_processor_id(), 0xa0);
-
     for ( seridx = 0; seridx <= SERHND_IDX; seridx++ )
     {
         if ( (irq = serial_dt_irq(seridx)) == NULL )
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 2e331d3..e5f4459 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -433,10 +433,6 @@ void __init start_xen(unsigned long boot_phys_offset,
     dt_unflatten_host_device_tree();
     dt_irq_xlate = gic_irq_xlate;
 
-#ifdef EARLY_UART_ADDRESS
-    /* TODO Need to get device tree or command line for UART address */
-    pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
-#endif
     dt_uart_init();
     console_init_preirq();
 
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 8efd08e..05b5ef1 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -22,9 +22,16 @@
 #include <xen/serial.h>
 #include <xen/init.h>
 #include <xen/irq.h>
+#include <asm/early_printk.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <asm/device.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
 
 static struct pl011 {
-    unsigned int baud, clock_hz, data_bits, parity, stop_bits, irq;
+    unsigned int baud, clock_hz, data_bits, parity, stop_bits;
+    struct dt_irq irq;
     volatile uint32_t *regs;
     /* UART with IRQ line: interrupt-driven I/O. */
     struct irqaction irqaction;
@@ -32,7 +39,7 @@ static struct pl011 {
     /* struct timer timer; */
     /* unsigned int timeout_ms; */
     /* bool_t probing, intr_works; */
-} pl011_com[2] = {{0}};
+} pl011_com = {0};
 
 /* PL011 register addresses */
 #define DR     (0x00/4)
@@ -163,13 +170,13 @@ static void __init pl011_init_postirq(struct serial_port *port)
     struct pl011 *uart = port->uart;
     int rc;
 
-    if ( uart->irq > 0 )
+    if ( uart->irq.irq > 0 )
     {
         uart->irqaction.handler = pl011_interrupt;
         uart->irqaction.name    = "pl011";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
+        if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
+            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq.irq);
     }
 
     /* Clear pending error interrupts */
@@ -215,7 +222,14 @@ static int pl011_getc(struct serial_port *port, char *pc)
 static int __init pl011_irq(struct serial_port *port)
 {
     struct pl011 *uart = port->uart;
-    return ((uart->irq > 0) ? uart->irq : -1);
+    return ((uart->irq.irq > 0) ? uart->irq.irq : -1);
+}
+
+static const struct dt_irq __init *pl011_dt_irq(struct serial_port *port)
+{
+    struct pl011 *uart = port->uart;
+
+    return &uart->irq;
 }
 
 static struct uart_driver __read_mostly pl011_driver = {
@@ -227,32 +241,74 @@ static struct uart_driver __read_mostly pl011_driver = {
     .tx_ready     = pl011_tx_ready,
     .putc         = pl011_putc,
     .getc         = pl011_getc,
-    .irq          = pl011_irq
+    .irq          = pl011_irq,
+    .dt_irq_get   = pl011_dt_irq,
 };
 
-/* TODO: Parse UART config from device-tree or command-line */
-
-void __init pl011_init(int index, unsigned long register_base_address)
+/* TODO: Parse UART config from the command line */
+static int __init pl011_uart_init(struct dt_device_node *dev,
+                                  const void *data)
 {
+    const char *config = data;
     struct pl011 *uart;
+    int res;
+    u64 addr, size;
 
-    if ( (index < 0) || (index > 1) )
-        return;
+    if ( strcmp(config, "") )
+    {
+        early_printk("WARNING: UART configuration is not supported\n");
+    }
 
-    uart = &pl011_com[index];
+    uart = &pl011_com;
 
     uart->clock_hz  = 0x16e3600;
     uart->baud      = 38400;
     uart->data_bits = 8;
     uart->parity    = PARITY_NONE;
     uart->stop_bits = 1;
-    uart->irq       = 37; /* TODO Need to find this from devicetree */
-    uart->regs      = (uint32_t *) register_base_address;
+
+    res = dt_device_get_address(dev, 0, &addr, &size);
+    if ( res )
+    {
+        early_printk("pl011: Unable to retrieve the base"
+                     " address of the UART\n");
+        return res;
+    }
+
+    uart->regs = ioremap_attr(addr, size, PAGE_HYPERVISOR_NOCACHE);
+    if ( !uart->regs )
+    {
+        early_printk("pl011: Unable to map the UART memory\n");
+
+        return -ENOMEM;
+    }
+
+    res = dt_device_get_irq(dev, 0, &uart->irq);
+    if ( res )
+    {
+        early_printk("pl011: Unable to retrieve the IRQ\n");
+        return res;
+    }
 
     /* Register with generic serial driver. */
-    serial_register_uart(uart - pl011_com, &pl011_driver, uart);
+    serial_register_uart(SERHND_DTUART, &pl011_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
 }
 
+static const char const *pl011_dt_compat[] __initdata =
+{
+    "arm,pl011",
+    NULL
+};
+
+DT_DEVICE_START(pl011, "PL011 UART", DEVICE_SERIAL)
+        .compatible = pl011_dt_compat,
+        .init = pl011_uart_init,
+DT_DEVICE_END
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 8af3bc4..9caf776 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -157,7 +157,6 @@ struct ns16550_defaults {
 void ns16550_init(int index, struct ns16550_defaults *defaults);
 void ehci_dbgp_init(void);
 
-void pl011_init(int index, unsigned long register_base_address);
 void __init dt_uart_init(void);
 
 struct physdev_dbgp_op;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6OH-0004A4-Lo; Tue, 14 May 2013 03: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 1Uc6OG-00049j-Ci
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:04 +0000
Received: from [85.158.137.99:56026] by server-2.bemta-3.messagelabs.com id
	5F/25-07011-786B1915; Tue, 14 May 2013 03:59:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1368503941!16314097!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26887 invoked from network); 14 May 2013 03:59:02 -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;
	14 May 2013 03:59:02 -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 1Uc6OD-0003Fb-92
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6OD-0006YD-6L
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:01 +0000
Date: Tue, 14 May 2013 03:59:01 +0000
Message-Id: <E1Uc6OD-0006YD-6L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use device tree API in pl011
	UART driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3baf9f2371f1627f186dba7a2d6db51f39745ce5
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 21:52:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Use device tree API in pl011 UART driver
    
    Allow UART driver to retrieve all its information in the device tree.
    It's possible to choose the pl011 driver via the Xen command line.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c       |    4 --
 xen/arch/arm/setup.c     |    4 --
 xen/drivers/char/pl011.c |   88 +++++++++++++++++++++++++++++++++++++--------
 xen/include/xen/serial.h |    1 -
 4 files changed, 72 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 761f570..648b1a0 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -505,10 +505,6 @@ void gic_route_spis(void)
     int seridx;
     const struct dt_irq *irq;
 
-    /* XXX should get these from DT */
-    /* UART */
-    gic_route_irq(37, 0, 1u << smp_processor_id(), 0xa0);
-
     for ( seridx = 0; seridx <= SERHND_IDX; seridx++ )
     {
         if ( (irq = serial_dt_irq(seridx)) == NULL )
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 2e331d3..e5f4459 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -433,10 +433,6 @@ void __init start_xen(unsigned long boot_phys_offset,
     dt_unflatten_host_device_tree();
     dt_irq_xlate = gic_irq_xlate;
 
-#ifdef EARLY_UART_ADDRESS
-    /* TODO Need to get device tree or command line for UART address */
-    pl011_init(0, FIXMAP_ADDR(FIXMAP_CONSOLE));
-#endif
     dt_uart_init();
     console_init_preirq();
 
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 8efd08e..05b5ef1 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -22,9 +22,16 @@
 #include <xen/serial.h>
 #include <xen/init.h>
 #include <xen/irq.h>
+#include <asm/early_printk.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <asm/device.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
 
 static struct pl011 {
-    unsigned int baud, clock_hz, data_bits, parity, stop_bits, irq;
+    unsigned int baud, clock_hz, data_bits, parity, stop_bits;
+    struct dt_irq irq;
     volatile uint32_t *regs;
     /* UART with IRQ line: interrupt-driven I/O. */
     struct irqaction irqaction;
@@ -32,7 +39,7 @@ static struct pl011 {
     /* struct timer timer; */
     /* unsigned int timeout_ms; */
     /* bool_t probing, intr_works; */
-} pl011_com[2] = {{0}};
+} pl011_com = {0};
 
 /* PL011 register addresses */
 #define DR     (0x00/4)
@@ -163,13 +170,13 @@ static void __init pl011_init_postirq(struct serial_port *port)
     struct pl011 *uart = port->uart;
     int rc;
 
-    if ( uart->irq > 0 )
+    if ( uart->irq.irq > 0 )
     {
         uart->irqaction.handler = pl011_interrupt;
         uart->irqaction.name    = "pl011";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
+        if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
+            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq.irq);
     }
 
     /* Clear pending error interrupts */
@@ -215,7 +222,14 @@ static int pl011_getc(struct serial_port *port, char *pc)
 static int __init pl011_irq(struct serial_port *port)
 {
     struct pl011 *uart = port->uart;
-    return ((uart->irq > 0) ? uart->irq : -1);
+    return ((uart->irq.irq > 0) ? uart->irq.irq : -1);
+}
+
+static const struct dt_irq __init *pl011_dt_irq(struct serial_port *port)
+{
+    struct pl011 *uart = port->uart;
+
+    return &uart->irq;
 }
 
 static struct uart_driver __read_mostly pl011_driver = {
@@ -227,32 +241,74 @@ static struct uart_driver __read_mostly pl011_driver = {
     .tx_ready     = pl011_tx_ready,
     .putc         = pl011_putc,
     .getc         = pl011_getc,
-    .irq          = pl011_irq
+    .irq          = pl011_irq,
+    .dt_irq_get   = pl011_dt_irq,
 };
 
-/* TODO: Parse UART config from device-tree or command-line */
-
-void __init pl011_init(int index, unsigned long register_base_address)
+/* TODO: Parse UART config from the command line */
+static int __init pl011_uart_init(struct dt_device_node *dev,
+                                  const void *data)
 {
+    const char *config = data;
     struct pl011 *uart;
+    int res;
+    u64 addr, size;
 
-    if ( (index < 0) || (index > 1) )
-        return;
+    if ( strcmp(config, "") )
+    {
+        early_printk("WARNING: UART configuration is not supported\n");
+    }
 
-    uart = &pl011_com[index];
+    uart = &pl011_com;
 
     uart->clock_hz  = 0x16e3600;
     uart->baud      = 38400;
     uart->data_bits = 8;
     uart->parity    = PARITY_NONE;
     uart->stop_bits = 1;
-    uart->irq       = 37; /* TODO Need to find this from devicetree */
-    uart->regs      = (uint32_t *) register_base_address;
+
+    res = dt_device_get_address(dev, 0, &addr, &size);
+    if ( res )
+    {
+        early_printk("pl011: Unable to retrieve the base"
+                     " address of the UART\n");
+        return res;
+    }
+
+    uart->regs = ioremap_attr(addr, size, PAGE_HYPERVISOR_NOCACHE);
+    if ( !uart->regs )
+    {
+        early_printk("pl011: Unable to map the UART memory\n");
+
+        return -ENOMEM;
+    }
+
+    res = dt_device_get_irq(dev, 0, &uart->irq);
+    if ( res )
+    {
+        early_printk("pl011: Unable to retrieve the IRQ\n");
+        return res;
+    }
 
     /* Register with generic serial driver. */
-    serial_register_uart(uart - pl011_com, &pl011_driver, uart);
+    serial_register_uart(SERHND_DTUART, &pl011_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
 }
 
+static const char const *pl011_dt_compat[] __initdata =
+{
+    "arm,pl011",
+    NULL
+};
+
+DT_DEVICE_START(pl011, "PL011 UART", DEVICE_SERIAL)
+        .compatible = pl011_dt_compat,
+        .init = pl011_uart_init,
+DT_DEVICE_END
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 8af3bc4..9caf776 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -157,7 +157,6 @@ struct ns16550_defaults {
 void ns16550_init(int index, struct ns16550_defaults *defaults);
 void ehci_dbgp_init(void);
 
-void pl011_init(int index, unsigned long register_base_address);
 void __init dt_uart_init(void);
 
 struct physdev_dbgp_op;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6OR-0004CK-Oh; Tue, 14 May 2013 03:59: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 1Uc6OQ-0004By-LX
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:14 +0000
Received: from [85.158.139.83:27642] by server-4.bemta-5.messagelabs.com id
	80/25-12332-196B1915; Tue, 14 May 2013 03:59:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1368503951!30190070!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2064 invoked from network); 14 May 2013 03:59:12 -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;
	14 May 2013 03:59: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 1Uc6ON-0003Fl-Ff
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6ON-0006Z7-Dg
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:11 +0000
Date: Tue, 14 May 2013 03:59:11 +0000
Message-Id: <E1Uc6ON-0006Z7-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use the device tree to map
	the address range and IRQ to 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

commit e20feb2925e4dc7459c18accb667b32892463ce0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 22:43:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Use the device tree to map the address range and IRQ to dom0
    
    - gic_route_irq_to_guest takes a dt_irq instead of an IRQ number
    - remove hardcoded address/IRQ
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |  146 +++++++++++++++++++++++++++++++++++++-----
 xen/arch/arm/gic.c          |   12 +++-
 xen/include/asm-arm/gic.h   |    3 +-
 3 files changed, 138 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 6581492..9a2ccad 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -14,6 +14,7 @@
 #include <asm/setup.h>
 
 #include <asm/gic.h>
+#include <xen/irq.h>
 #include "kernel.h"
 
 static unsigned int __initdata opt_dom0_max_vcpus;
@@ -30,6 +31,14 @@ static void __init parse_dom0_mem(const char *s)
 }
 custom_param("dom0_mem", parse_dom0_mem);
 
+//#define DEBUG_DT
+
+#ifdef DEBUG_DT
+# define DPRINT(fmt, args...) printk(XENLOG_DEBUG fmt, ##args)
+#else
+# define DPRINT(fmt, args...) do {} while ( 0 )
+#endif
+
 /*
  * Amount of extra space required to dom0's device tree.  No new nodes
  * are added (yet) but one terminating reserve map entry (16 bytes) is
@@ -303,6 +312,124 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo,
     return 0;
 }
 
+/* Map the device in the domain */
+static int map_device(struct domain *d, const struct dt_device_node *dev)
+{
+    unsigned int nirq;
+    unsigned int naddr;
+    unsigned int i;
+    int res;
+    struct dt_irq irq;
+    struct dt_raw_irq rirq;
+    u64 addr, size;
+
+    nirq = dt_number_of_irq(dev);
+    naddr = dt_number_of_address(dev);
+
+    DPRINT("%s nirq = %d naddr = %u\n", dt_node_full_name(dev), nirq, naddr);
+
+    /* Map IRQs */
+    for ( i = 0; i < nirq; i++ )
+    {
+        res = dt_device_get_raw_irq(dev, i, &rirq);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to retrieve irq %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        /*
+         * Don't map IRQ that have no physical meaning
+         * ie: IRQ whose controller is not the GIC
+         */
+        if ( rirq.controller != dt_interrupt_controller )
+        {
+            DPRINT("irq %u not connected to primary controller."
+                   "Connected to %s\n", i, dt_node_full_name(rirq.controller));
+            continue;
+        }
+
+        res = dt_irq_translate(&rirq, &irq);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to translate irq %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        DPRINT("irq %u = %u type = 0x%x\n", i, irq.irq, irq.type);
+        /* Don't check return because the IRQ can be use by multiple device */
+        gic_route_irq_to_guest(d, &irq, dt_node_name(dev));
+    }
+
+    /* Map the address ranges */
+    for ( i = 0; i < naddr; i++ )
+    {
+        res = dt_device_get_address(dev, i, &addr, &size);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to retrieve address %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        DPRINT("addr %u = 0x%"PRIx64" - 0x%"PRIx64"\n",
+               i, addr, addr + size - 1);
+
+        res = map_mmio_regions(d, addr & PAGE_MASK,
+                               PAGE_ALIGN(addr + size) - 1,
+                               addr & PAGE_MASK);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to map 0x%"PRIx64
+                   " - 0x%"PRIx64" in dom0\n",
+                   addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
+            return res;
+        }
+    }
+
+    return 0;
+}
+
+static int handle_node(struct domain *d, const struct dt_device_node *np)
+{
+    const struct dt_device_node *child;
+    int res;
+
+    DPRINT("handle %s\n", dt_node_full_name(np));
+
+    /* Skip theses nodes and the sub-nodes */
+    if ( dt_device_is_compatible(np, "xen,xen") ||
+         dt_device_type_is_equal(np, "memory") ||
+         !strcmp("/chosen", dt_node_full_name(np)) )
+        return 0;
+
+    if ( dt_device_used_by(np) != DOMID_XEN )
+    {
+        res = map_device(d, np);
+
+        if ( res )
+            return res;
+    }
+
+    for ( child = np->child; child != NULL; child = child->sibling )
+    {
+        res = handle_node(d, child);
+        if ( res )
+            return res;
+    }
+
+    return 0;
+}
+
+static int map_devices_from_device_tree(struct domain *d)
+{
+    ASSERT(dt_host && (dt_host->sibling == NULL));
+
+    return handle_node(d, dt_host);
+}
+
 static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
 {
     void *fdt;
@@ -385,24 +512,7 @@ int construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    printk("Map CS2 MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x18000000ULL, 0x1BFFFFFFULL);
-    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("Routing peripheral interrupts to guest\n");
-    /* TODO Get from device tree */
-    gic_route_irq_to_guest(d, 34, "timer0");
-    /*gic_route_irq_to_guest(d, 37, "uart0"); -- XXX used by Xen*/
-    gic_route_irq_to_guest(d, 38, "uart1");
-    gic_route_irq_to_guest(d, 39, "uart2");
-    gic_route_irq_to_guest(d, 40, "uart3");
-    gic_route_irq_to_guest(d, 41, "mmc0-1");
-    gic_route_irq_to_guest(d, 42, "mmc0-2");
-    gic_route_irq_to_guest(d, 44, "keyboard");
-    gic_route_irq_to_guest(d, 45, "mouse");
-    gic_route_irq_to_guest(d, 46, "lcd");
-    gic_route_irq_to_guest(d, 47, "eth");
+    map_devices_from_device_tree(d);
 
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 648b1a0..c7ff21c 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -696,13 +696,14 @@ void gic_inject(void)
         gic_inject_irq_start();
 }
 
-int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
+int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
                            const char * devname)
 {
     struct irqaction *action;
-    struct irq_desc *desc = irq_to_desc(irq);
+    struct irq_desc *desc = irq_to_desc(irq->irq);
     unsigned long flags;
     int retval;
+    bool_t level;
 
     action = xmalloc(struct irqaction);
     if (!action)
@@ -710,6 +711,7 @@ int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
 
     action->dev_id = d;
     action->name = devname;
+    action->free_on_release = 1;
 
     spin_lock_irqsave(&desc->lock, flags);
     spin_lock(&gic.lock);
@@ -717,9 +719,11 @@ int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
     desc->handler = &gic_guest_irq_type;
     desc->status |= IRQ_GUEST;
 
-    gic_set_irq_properties(irq, 1, 1u << smp_processor_id(), 0xa0);
+    level = dt_irq_is_level_triggered(irq);
+
+    gic_set_irq_properties(irq->irq, level, 1u << smp_processor_id(), 0xa0);
 
-    retval = __setup_irq(desc, irq, action);
+    retval = __setup_irq(desc, irq->irq, action);
     if (retval) {
         xfree(action);
         goto out;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index e7608dc..513c1fc 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -157,7 +157,8 @@ extern int gic_events_need_delivery(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,
+extern int gic_route_irq_to_guest(struct domain *d,
+                                  const struct dt_irq *irq,
                                   const char * devname);
 
 /* Accept an interrupt from the GIC and dispatch its handler */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6OR-0004CK-Oh; Tue, 14 May 2013 03:59: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 1Uc6OQ-0004By-LX
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:14 +0000
Received: from [85.158.139.83:27642] by server-4.bemta-5.messagelabs.com id
	80/25-12332-196B1915; Tue, 14 May 2013 03:59:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1368503951!30190070!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2064 invoked from network); 14 May 2013 03:59:12 -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;
	14 May 2013 03:59: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 1Uc6ON-0003Fl-Ff
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6ON-0006Z7-Dg
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:11 +0000
Date: Tue, 14 May 2013 03:59:11 +0000
Message-Id: <E1Uc6ON-0006Z7-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use the device tree to map
	the address range and IRQ to 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

commit e20feb2925e4dc7459c18accb667b32892463ce0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 22:43:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Use the device tree to map the address range and IRQ to dom0
    
    - gic_route_irq_to_guest takes a dt_irq instead of an IRQ number
    - remove hardcoded address/IRQ
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |  146 +++++++++++++++++++++++++++++++++++++-----
 xen/arch/arm/gic.c          |   12 +++-
 xen/include/asm-arm/gic.h   |    3 +-
 3 files changed, 138 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 6581492..9a2ccad 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -14,6 +14,7 @@
 #include <asm/setup.h>
 
 #include <asm/gic.h>
+#include <xen/irq.h>
 #include "kernel.h"
 
 static unsigned int __initdata opt_dom0_max_vcpus;
@@ -30,6 +31,14 @@ static void __init parse_dom0_mem(const char *s)
 }
 custom_param("dom0_mem", parse_dom0_mem);
 
+//#define DEBUG_DT
+
+#ifdef DEBUG_DT
+# define DPRINT(fmt, args...) printk(XENLOG_DEBUG fmt, ##args)
+#else
+# define DPRINT(fmt, args...) do {} while ( 0 )
+#endif
+
 /*
  * Amount of extra space required to dom0's device tree.  No new nodes
  * are added (yet) but one terminating reserve map entry (16 bytes) is
@@ -303,6 +312,124 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo,
     return 0;
 }
 
+/* Map the device in the domain */
+static int map_device(struct domain *d, const struct dt_device_node *dev)
+{
+    unsigned int nirq;
+    unsigned int naddr;
+    unsigned int i;
+    int res;
+    struct dt_irq irq;
+    struct dt_raw_irq rirq;
+    u64 addr, size;
+
+    nirq = dt_number_of_irq(dev);
+    naddr = dt_number_of_address(dev);
+
+    DPRINT("%s nirq = %d naddr = %u\n", dt_node_full_name(dev), nirq, naddr);
+
+    /* Map IRQs */
+    for ( i = 0; i < nirq; i++ )
+    {
+        res = dt_device_get_raw_irq(dev, i, &rirq);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to retrieve irq %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        /*
+         * Don't map IRQ that have no physical meaning
+         * ie: IRQ whose controller is not the GIC
+         */
+        if ( rirq.controller != dt_interrupt_controller )
+        {
+            DPRINT("irq %u not connected to primary controller."
+                   "Connected to %s\n", i, dt_node_full_name(rirq.controller));
+            continue;
+        }
+
+        res = dt_irq_translate(&rirq, &irq);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to translate irq %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        DPRINT("irq %u = %u type = 0x%x\n", i, irq.irq, irq.type);
+        /* Don't check return because the IRQ can be use by multiple device */
+        gic_route_irq_to_guest(d, &irq, dt_node_name(dev));
+    }
+
+    /* Map the address ranges */
+    for ( i = 0; i < naddr; i++ )
+    {
+        res = dt_device_get_address(dev, i, &addr, &size);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to retrieve address %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        DPRINT("addr %u = 0x%"PRIx64" - 0x%"PRIx64"\n",
+               i, addr, addr + size - 1);
+
+        res = map_mmio_regions(d, addr & PAGE_MASK,
+                               PAGE_ALIGN(addr + size) - 1,
+                               addr & PAGE_MASK);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to map 0x%"PRIx64
+                   " - 0x%"PRIx64" in dom0\n",
+                   addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
+            return res;
+        }
+    }
+
+    return 0;
+}
+
+static int handle_node(struct domain *d, const struct dt_device_node *np)
+{
+    const struct dt_device_node *child;
+    int res;
+
+    DPRINT("handle %s\n", dt_node_full_name(np));
+
+    /* Skip theses nodes and the sub-nodes */
+    if ( dt_device_is_compatible(np, "xen,xen") ||
+         dt_device_type_is_equal(np, "memory") ||
+         !strcmp("/chosen", dt_node_full_name(np)) )
+        return 0;
+
+    if ( dt_device_used_by(np) != DOMID_XEN )
+    {
+        res = map_device(d, np);
+
+        if ( res )
+            return res;
+    }
+
+    for ( child = np->child; child != NULL; child = child->sibling )
+    {
+        res = handle_node(d, child);
+        if ( res )
+            return res;
+    }
+
+    return 0;
+}
+
+static int map_devices_from_device_tree(struct domain *d)
+{
+    ASSERT(dt_host && (dt_host->sibling == NULL));
+
+    return handle_node(d, dt_host);
+}
+
 static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
 {
     void *fdt;
@@ -385,24 +512,7 @@ int construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    printk("Map CS2 MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x18000000ULL, 0x1BFFFFFFULL);
-    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("Routing peripheral interrupts to guest\n");
-    /* TODO Get from device tree */
-    gic_route_irq_to_guest(d, 34, "timer0");
-    /*gic_route_irq_to_guest(d, 37, "uart0"); -- XXX used by Xen*/
-    gic_route_irq_to_guest(d, 38, "uart1");
-    gic_route_irq_to_guest(d, 39, "uart2");
-    gic_route_irq_to_guest(d, 40, "uart3");
-    gic_route_irq_to_guest(d, 41, "mmc0-1");
-    gic_route_irq_to_guest(d, 42, "mmc0-2");
-    gic_route_irq_to_guest(d, 44, "keyboard");
-    gic_route_irq_to_guest(d, 45, "mouse");
-    gic_route_irq_to_guest(d, 46, "lcd");
-    gic_route_irq_to_guest(d, 47, "eth");
+    map_devices_from_device_tree(d);
 
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 648b1a0..c7ff21c 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -696,13 +696,14 @@ void gic_inject(void)
         gic_inject_irq_start();
 }
 
-int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
+int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
                            const char * devname)
 {
     struct irqaction *action;
-    struct irq_desc *desc = irq_to_desc(irq);
+    struct irq_desc *desc = irq_to_desc(irq->irq);
     unsigned long flags;
     int retval;
+    bool_t level;
 
     action = xmalloc(struct irqaction);
     if (!action)
@@ -710,6 +711,7 @@ int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
 
     action->dev_id = d;
     action->name = devname;
+    action->free_on_release = 1;
 
     spin_lock_irqsave(&desc->lock, flags);
     spin_lock(&gic.lock);
@@ -717,9 +719,11 @@ int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
     desc->handler = &gic_guest_irq_type;
     desc->status |= IRQ_GUEST;
 
-    gic_set_irq_properties(irq, 1, 1u << smp_processor_id(), 0xa0);
+    level = dt_irq_is_level_triggered(irq);
+
+    gic_set_irq_properties(irq->irq, level, 1u << smp_processor_id(), 0xa0);
 
-    retval = __setup_irq(desc, irq, action);
+    retval = __setup_irq(desc, irq->irq, action);
     if (retval) {
         xfree(action);
         goto out;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index e7608dc..513c1fc 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -157,7 +157,8 @@ extern int gic_events_need_delivery(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,
+extern int gic_route_irq_to_guest(struct domain *d,
+                                  const struct dt_irq *irq,
                                   const char * devname);
 
 /* Accept an interrupt from the GIC and dispatch its handler */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6Ob-0004EQ-Re; Tue, 14 May 2013 03:59: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 1Uc6Oa-0004E9-PZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:25 +0000
Received: from [85.158.137.99:49833] by server-12.bemta-3.messagelabs.com id
	D8/6A-17342-C96B1915; Tue, 14 May 2013 03:59:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1368503961!18583882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32507 invoked from network); 14 May 2013 03:59:22 -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;
	14 May 2013 03:59: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 1Uc6OX-0003Fr-MN
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6OX-0006ZT-Ko
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:21 +0000
Date: Tue, 14 May 2013 03:59:21 +0000
Message-Id: <E1Uc6OX-0006ZT-Ko@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Allow Xen to run on multiple
	platform without recompilation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 93f8194038ebddca5898cf889b45a5dc0ba903c1
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 23:03:25 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Allow Xen to run on multiple platform without recompilation
    
    Xen can include various platform support (ie: exynos5, versatile express...)
    and choose during boot time a set of callbacks for the current board.
    These callbacks will be called in places where each board can have specific
    code. For the moment the callbacks are:
        - platform_init: additional initialization for the platform
        - platform_init_time: some platform (ie: Exynos 5) needs to initialize
        the timer with an uncommon way
        - platform_specific_mapping: add mapping to dom0 which are not specified
        in the device tree
        - platform_reset: reset the platform
        - platform_poweroff: poweroff the platform
        - platform_quirks: list of quirks for a specific board.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile          |    1 +
 xen/arch/arm/domain_build.c    |    4 +
 xen/arch/arm/platform.c        |  137 ++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/setup.c           |    3 +
 xen/arch/arm/shutdown.c        |    2 +
 xen/arch/arm/time.c            |    6 ++
 xen/arch/arm/xen.lds.S         |    7 ++
 xen/include/asm-arm/platform.h |   55 ++++++++++++++++
 8 files changed, 215 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 4955a21..2717f26 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -18,6 +18,7 @@ obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += physdev.o
+obj-y += platform.o
 obj-y += setup.o
 obj-y += time.o
 obj-y += smpboot.o
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 9a2ccad..75c3006 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -12,6 +12,7 @@
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
 #include <asm/setup.h>
+#include <asm/platform.h>
 
 #include <asm/gic.h>
 #include <xen/irq.h>
@@ -513,6 +514,9 @@ int construct_dom0(struct domain *d)
         return rc;
 
     map_devices_from_device_tree(d);
+    rc = platform_specific_mapping(d);
+    if ( rc < 0 )
+        return rc;
 
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
new file mode 100644
index 0000000..afda302
--- /dev/null
+++ b/xen/arch/arm/platform.c
@@ -0,0 +1,137 @@
+/*
+ * xen/arch/arm/platform.c
+ *
+ * Helpers to execute platform specific code.
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (C) 2013 Linaro Limited.
+ *
+ * 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/platform.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+
+extern const struct platform_desc _splatform[], _eplatform[];
+
+/* Pointer to the current platform description */
+static const struct platform_desc *platform;
+
+
+static bool_t __init platform_is_compatible(const struct platform_desc *plat)
+{
+    const char *const *compat;
+
+    if ( !plat->compatible )
+        return 0;
+
+    for ( compat = plat->compatible; *compat; compat++ )
+    {
+        if ( dt_machine_is_compatible(*compat) )
+            return 1;
+    }
+
+    return 0;
+}
+
+/* List of possible platform */
+static void dump_platform_table(void)
+{
+    const struct platform_desc *p;
+
+    printk("Available platform support:\n");
+
+    for ( p = _splatform; p != _eplatform; p++ )
+        printk("    - %s\n", p->name);
+}
+
+int __init platform_init(void)
+{
+    int res = 0;
+
+    ASSERT(platform == NULL);
+
+    /* Looking for the platform description */
+    for ( platform = _splatform; platform != _eplatform; platform++ )
+    {
+        if ( platform_is_compatible(platform) )
+            break;
+    }
+
+    /* We don't have specific operations for this platform */
+    if ( platform == _eplatform )
+    {
+        /* TODO: dump DT machine compatible node */
+        printk(XENLOG_WARNING "WARNING: Unrecognized/unsupported device tree "
+              "compatible list\n");
+        dump_platform_table();
+        platform = NULL;
+    }
+    else
+        printk(XENLOG_INFO "Platform: %s\n", platform->name);
+
+    if ( platform && platform->init )
+        res = platform->init();
+
+    return res;
+}
+
+int __init platform_init_time(void)
+{
+    int res = 0;
+
+    if ( platform && platform->init_time )
+        res = platform->init_time();
+
+    return res;
+}
+
+int __init platform_specific_mapping(struct domain *d)
+{
+    int res = 0;
+
+    if ( platform && platform->specific_mapping )
+        res = platform->specific_mapping(d);
+
+    return res;
+}
+
+void platform_reset(void)
+{
+    if ( platform && platform->reset )
+        platform->reset();
+}
+
+void platform_poweroff(void)
+{
+    if ( platform && platform->poweroff )
+        platform->poweroff();
+}
+
+bool_t platform_has_quirk(uint32_t quirk)
+{
+    uint32_t quirks = 0;
+
+    if ( platform && platform->quirks )
+        quirks = platform->quirks();
+
+    return !!(quirks & quirk);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index e5f4459..da2a734 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -42,6 +42,7 @@
 #include <asm/early_printk.h>
 #include <asm/gic.h>
 #include <asm/cpufeature.h>
+#include <asm/platform.h>
 
 struct cpuinfo_arm __read_mostly boot_cpu_data;
 
@@ -440,6 +441,8 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     processor_id();
 
+    platform_init();
+
     init_xen_time();
 
     gic_init();
diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index 61b5280..0903842 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -5,6 +5,7 @@
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/smp.h>
+#include <asm/platform.h>
 
 static void raw_machine_reset(void)
 {
@@ -21,6 +22,7 @@ static void raw_machine_reset(void)
     dsb(); isb();
     clear_fixmap(FIXMAP_MISC);
 #endif
+    platform_reset();
 }
 
 static void halt_this_cpu(void *arg)
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 2e928bc..db849cf 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -33,6 +33,7 @@
 #include <asm/time.h>
 #include <asm/gic.h>
 #include <asm/cpufeature.h>
+#include <asm/platform.h>
 
 /*
  * Unfortunately the hypervisor timer interrupt appears to be buggy in
@@ -123,11 +124,16 @@ int __init init_xen_time(void)
            timer_irq[TIMER_HYP_PPI].irq,
            timer_irq[TIMER_VIRT_PPI].irq);
 
+    res = platform_init_time();
+    if ( res )
+        return res;
+
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
         panic("CPU does not support the Generic Timer v1 interface.\n");
 
     cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
+
     boot_count = READ_SYSREG64(CNTPCT_EL0);
     printk("Using generic timer at %lu KHz\n", cpu_khz);
 
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index deab040..3b60668 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -77,6 +77,13 @@ SECTIONS
 #endif
 
   . = ALIGN(8);
+  .arch.info : {
+      _splatform = .;
+      *(.arch.info)
+      _eplatform = .;
+  } :text
+
+  . = ALIGN(8);
   .dev.info : {
       _sdevice = .;
       *(.dev.info)
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
new file mode 100644
index 0000000..e116265
--- /dev/null
+++ b/xen/include/asm-arm/platform.h
@@ -0,0 +1,55 @@
+#ifndef __ASM_ARM_PLATFORM_H
+#define __ASM_ARM_PLATFORM_H
+
+#include <xen/init.h>
+#include <xen/sched.h>
+#include <xen/mm.h>
+
+/* Describe specific operation for a board */
+struct platform_desc {
+    /* Platform name */
+    const char *name;
+    /* Array of device tree 'compatible' strings */
+    const char *const *compatible;
+    /* Platform initialization */
+    int (*init)(void);
+    int (*init_time)(void);
+    /* Specific mapping for dom0 */
+    int (*specific_mapping)(struct domain *d);
+    /* Platform reset */
+    void (*reset)(void);
+    /* Platform power-off */
+    void (*poweroff)(void);
+    /*
+     * Platform quirks
+     * Defined has a function because a platform can support multiple
+     * board with different quirk on each
+     */
+    uint32_t (*quirks)(void);
+};
+
+int __init platform_init(void);
+int __init platform_init_time(void);
+int __init platform_specific_mapping(struct domain *d);
+void platform_reset(void);
+void platform_poweroff(void);
+bool_t platform_has_quirk(uint32_t quirk);
+
+#define PLATFORM_START(_name, _namestr)                         \
+static const struct platform_desc  __plat_desc_##_name __used   \
+__attribute__((__section__(".arch.info"))) = {                  \
+    .name = _namestr,
+
+#define PLATFORM_END                                            \
+};
+
+#endif /* __ASM_ARM_PLATFORM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6Ob-0004EQ-Re; Tue, 14 May 2013 03:59: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 1Uc6Oa-0004E9-PZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:25 +0000
Received: from [85.158.137.99:49833] by server-12.bemta-3.messagelabs.com id
	D8/6A-17342-C96B1915; Tue, 14 May 2013 03:59:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1368503961!18583882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32507 invoked from network); 14 May 2013 03:59:22 -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;
	14 May 2013 03:59: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 1Uc6OX-0003Fr-MN
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6OX-0006ZT-Ko
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:21 +0000
Date: Tue, 14 May 2013 03:59:21 +0000
Message-Id: <E1Uc6OX-0006ZT-Ko@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Allow Xen to run on multiple
	platform without recompilation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 93f8194038ebddca5898cf889b45a5dc0ba903c1
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 23:03:25 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Allow Xen to run on multiple platform without recompilation
    
    Xen can include various platform support (ie: exynos5, versatile express...)
    and choose during boot time a set of callbacks for the current board.
    These callbacks will be called in places where each board can have specific
    code. For the moment the callbacks are:
        - platform_init: additional initialization for the platform
        - platform_init_time: some platform (ie: Exynos 5) needs to initialize
        the timer with an uncommon way
        - platform_specific_mapping: add mapping to dom0 which are not specified
        in the device tree
        - platform_reset: reset the platform
        - platform_poweroff: poweroff the platform
        - platform_quirks: list of quirks for a specific board.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile          |    1 +
 xen/arch/arm/domain_build.c    |    4 +
 xen/arch/arm/platform.c        |  137 ++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/setup.c           |    3 +
 xen/arch/arm/shutdown.c        |    2 +
 xen/arch/arm/time.c            |    6 ++
 xen/arch/arm/xen.lds.S         |    7 ++
 xen/include/asm-arm/platform.h |   55 ++++++++++++++++
 8 files changed, 215 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 4955a21..2717f26 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -18,6 +18,7 @@ obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += physdev.o
+obj-y += platform.o
 obj-y += setup.o
 obj-y += time.o
 obj-y += smpboot.o
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 9a2ccad..75c3006 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -12,6 +12,7 @@
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
 #include <asm/setup.h>
+#include <asm/platform.h>
 
 #include <asm/gic.h>
 #include <xen/irq.h>
@@ -513,6 +514,9 @@ int construct_dom0(struct domain *d)
         return rc;
 
     map_devices_from_device_tree(d);
+    rc = platform_specific_mapping(d);
+    if ( rc < 0 )
+        return rc;
 
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
new file mode 100644
index 0000000..afda302
--- /dev/null
+++ b/xen/arch/arm/platform.c
@@ -0,0 +1,137 @@
+/*
+ * xen/arch/arm/platform.c
+ *
+ * Helpers to execute platform specific code.
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (C) 2013 Linaro Limited.
+ *
+ * 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/platform.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+
+extern const struct platform_desc _splatform[], _eplatform[];
+
+/* Pointer to the current platform description */
+static const struct platform_desc *platform;
+
+
+static bool_t __init platform_is_compatible(const struct platform_desc *plat)
+{
+    const char *const *compat;
+
+    if ( !plat->compatible )
+        return 0;
+
+    for ( compat = plat->compatible; *compat; compat++ )
+    {
+        if ( dt_machine_is_compatible(*compat) )
+            return 1;
+    }
+
+    return 0;
+}
+
+/* List of possible platform */
+static void dump_platform_table(void)
+{
+    const struct platform_desc *p;
+
+    printk("Available platform support:\n");
+
+    for ( p = _splatform; p != _eplatform; p++ )
+        printk("    - %s\n", p->name);
+}
+
+int __init platform_init(void)
+{
+    int res = 0;
+
+    ASSERT(platform == NULL);
+
+    /* Looking for the platform description */
+    for ( platform = _splatform; platform != _eplatform; platform++ )
+    {
+        if ( platform_is_compatible(platform) )
+            break;
+    }
+
+    /* We don't have specific operations for this platform */
+    if ( platform == _eplatform )
+    {
+        /* TODO: dump DT machine compatible node */
+        printk(XENLOG_WARNING "WARNING: Unrecognized/unsupported device tree "
+              "compatible list\n");
+        dump_platform_table();
+        platform = NULL;
+    }
+    else
+        printk(XENLOG_INFO "Platform: %s\n", platform->name);
+
+    if ( platform && platform->init )
+        res = platform->init();
+
+    return res;
+}
+
+int __init platform_init_time(void)
+{
+    int res = 0;
+
+    if ( platform && platform->init_time )
+        res = platform->init_time();
+
+    return res;
+}
+
+int __init platform_specific_mapping(struct domain *d)
+{
+    int res = 0;
+
+    if ( platform && platform->specific_mapping )
+        res = platform->specific_mapping(d);
+
+    return res;
+}
+
+void platform_reset(void)
+{
+    if ( platform && platform->reset )
+        platform->reset();
+}
+
+void platform_poweroff(void)
+{
+    if ( platform && platform->poweroff )
+        platform->poweroff();
+}
+
+bool_t platform_has_quirk(uint32_t quirk)
+{
+    uint32_t quirks = 0;
+
+    if ( platform && platform->quirks )
+        quirks = platform->quirks();
+
+    return !!(quirks & quirk);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index e5f4459..da2a734 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -42,6 +42,7 @@
 #include <asm/early_printk.h>
 #include <asm/gic.h>
 #include <asm/cpufeature.h>
+#include <asm/platform.h>
 
 struct cpuinfo_arm __read_mostly boot_cpu_data;
 
@@ -440,6 +441,8 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     processor_id();
 
+    platform_init();
+
     init_xen_time();
 
     gic_init();
diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index 61b5280..0903842 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -5,6 +5,7 @@
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/smp.h>
+#include <asm/platform.h>
 
 static void raw_machine_reset(void)
 {
@@ -21,6 +22,7 @@ static void raw_machine_reset(void)
     dsb(); isb();
     clear_fixmap(FIXMAP_MISC);
 #endif
+    platform_reset();
 }
 
 static void halt_this_cpu(void *arg)
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 2e928bc..db849cf 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -33,6 +33,7 @@
 #include <asm/time.h>
 #include <asm/gic.h>
 #include <asm/cpufeature.h>
+#include <asm/platform.h>
 
 /*
  * Unfortunately the hypervisor timer interrupt appears to be buggy in
@@ -123,11 +124,16 @@ int __init init_xen_time(void)
            timer_irq[TIMER_HYP_PPI].irq,
            timer_irq[TIMER_VIRT_PPI].irq);
 
+    res = platform_init_time();
+    if ( res )
+        return res;
+
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
         panic("CPU does not support the Generic Timer v1 interface.\n");
 
     cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
+
     boot_count = READ_SYSREG64(CNTPCT_EL0);
     printk("Using generic timer at %lu KHz\n", cpu_khz);
 
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index deab040..3b60668 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -77,6 +77,13 @@ SECTIONS
 #endif
 
   . = ALIGN(8);
+  .arch.info : {
+      _splatform = .;
+      *(.arch.info)
+      _eplatform = .;
+  } :text
+
+  . = ALIGN(8);
   .dev.info : {
       _sdevice = .;
       *(.dev.info)
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
new file mode 100644
index 0000000..e116265
--- /dev/null
+++ b/xen/include/asm-arm/platform.h
@@ -0,0 +1,55 @@
+#ifndef __ASM_ARM_PLATFORM_H
+#define __ASM_ARM_PLATFORM_H
+
+#include <xen/init.h>
+#include <xen/sched.h>
+#include <xen/mm.h>
+
+/* Describe specific operation for a board */
+struct platform_desc {
+    /* Platform name */
+    const char *name;
+    /* Array of device tree 'compatible' strings */
+    const char *const *compatible;
+    /* Platform initialization */
+    int (*init)(void);
+    int (*init_time)(void);
+    /* Specific mapping for dom0 */
+    int (*specific_mapping)(struct domain *d);
+    /* Platform reset */
+    void (*reset)(void);
+    /* Platform power-off */
+    void (*poweroff)(void);
+    /*
+     * Platform quirks
+     * Defined has a function because a platform can support multiple
+     * board with different quirk on each
+     */
+    uint32_t (*quirks)(void);
+};
+
+int __init platform_init(void);
+int __init platform_init_time(void);
+int __init platform_specific_mapping(struct domain *d);
+void platform_reset(void);
+void platform_poweroff(void);
+bool_t platform_has_quirk(uint32_t quirk);
+
+#define PLATFORM_START(_name, _namestr)                         \
+static const struct platform_desc  __plat_desc_##_name __used   \
+__attribute__((__section__(".arch.info"))) = {                  \
+    .name = _namestr,
+
+#define PLATFORM_END                                            \
+};
+
+#endif /* __ASM_ARM_PLATFORM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6Om-0004GD-0V; Tue, 14 May 2013 03:59: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 1Uc6Ok-0004Fs-KU
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:34 +0000
Received: from [85.158.139.83:55501] by server-10.bemta-5.messagelabs.com id
	E8/A6-19016-5A6B1915; Tue, 14 May 2013 03:59:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1368503972!28564408!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26986 invoked from network); 14 May 2013 03:59:33 -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;
	14 May 2013 03:59: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 1Uc6Oh-0003Fz-SY
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Oh-0006Zq-Q3
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:31 +0000
Date: Tue, 14 May 2013 03:59:31 +0000
Message-Id: <E1Uc6Oh-0006Zq-Q3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: WORKAROUND 1:1 memory mapping
	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

commit 3c186690bb6c8e7da7a24f83c8d8c884b1ba46a2
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 22:52:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: WORKAROUND 1:1 memory mapping for dom0
    
    Currently xen doesn't implement SYS MMU. When a device will talk with dom0
    with DMA request the domain will use GFN instead of MFN.
    For instance on the arndale board, without this patch the network doesn't
    work.
    
    The 1:1 mapping is a workaround and MUST be remove as soon as a SYS MMU is
    implemented in XEN.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c    |   41 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/platform.h |    6 +++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 75c3006..8369099 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -62,6 +62,43 @@ struct vcpu *__init alloc_dom0_vcpu0(void)
     return alloc_vcpu(dom0, 0, 0);
 }
 
+static int set_memory_reg_11(struct domain *d, struct kernel_info *kinfo,
+                             const void *fdt, const u32 *cell, int len,
+                             int address_cells, int size_cells, u32 *new_cell)
+{
+    int reg_size = (address_cells + size_cells) * sizeof(*cell);
+    paddr_t start;
+    paddr_t size;
+    struct page_info *pg;
+    unsigned int order = get_order_from_bytes(dom0_mem);
+    int res;
+    paddr_t spfn;
+
+    pg = alloc_domheap_pages(d, order, 0);
+    if ( !pg )
+        panic("Failed to allocate contiguous memory for dom0\n");
+
+    spfn = page_to_mfn(pg);
+    start = spfn << PAGE_SHIFT;
+    size = (1 << order) << PAGE_SHIFT;
+
+    // 1:1 mapping
+    printk("Populate P2M %#"PRIx64"->%#"PRIx64" (1:1 mapping for dom0)\n",
+           start, start + size);
+    res = guest_physmap_add_page(d, spfn, spfn, order);
+
+    if ( res )
+        panic("Unable to add pages in DOM0: %d\n", res);
+
+    device_tree_set_reg(&new_cell, address_cells, size_cells, start, size);
+
+    kinfo->mem.bank[0].start = start;
+    kinfo->mem.bank[0].size = size;
+    kinfo->mem.nr_banks = 1;
+
+    return reg_size;
+}
+
 static int set_memory_reg(struct domain *d, struct kernel_info *kinfo,
                           const void *fdt, const u32 *cell, int len,
                           int address_cells, int size_cells, u32 *new_cell)
@@ -71,6 +108,10 @@ static int set_memory_reg(struct domain *d, struct kernel_info *kinfo,
     u64 start;
     u64 size;
 
+    if ( platform_has_quirk(PLATFORM_QUIRK_DOM0_MAPPING_11) )
+        return set_memory_reg_11(d, kinfo, fdt, cell, len, address_cells,
+                                 size_cells, new_cell);
+
     while ( kinfo->unassigned_mem > 0 && l + reg_size <= len
             && kinfo->mem.nr_banks < NR_MEM_BANKS )
     {
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index e116265..f460e9c 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -28,6 +28,12 @@ struct platform_desc {
     uint32_t (*quirks)(void);
 };
 
+/*
+ * Quirk to map dom0 memory in 1:1
+ * Usefull on platform where System MMU is not yet implemented
+ */
+#define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
+
 int __init platform_init(void);
 int __init platform_init_time(void);
 int __init platform_specific_mapping(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6Om-0004GD-0V; Tue, 14 May 2013 03:59: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 1Uc6Ok-0004Fs-KU
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:34 +0000
Received: from [85.158.139.83:55501] by server-10.bemta-5.messagelabs.com id
	E8/A6-19016-5A6B1915; Tue, 14 May 2013 03:59:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1368503972!28564408!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26986 invoked from network); 14 May 2013 03:59:33 -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;
	14 May 2013 03:59: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 1Uc6Oh-0003Fz-SY
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Oh-0006Zq-Q3
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:31 +0000
Date: Tue, 14 May 2013 03:59:31 +0000
Message-Id: <E1Uc6Oh-0006Zq-Q3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: WORKAROUND 1:1 memory mapping
	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

commit 3c186690bb6c8e7da7a24f83c8d8c884b1ba46a2
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Apr 27 22:52:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: WORKAROUND 1:1 memory mapping for dom0
    
    Currently xen doesn't implement SYS MMU. When a device will talk with dom0
    with DMA request the domain will use GFN instead of MFN.
    For instance on the arndale board, without this patch the network doesn't
    work.
    
    The 1:1 mapping is a workaround and MUST be remove as soon as a SYS MMU is
    implemented in XEN.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c    |   41 ++++++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/platform.h |    6 +++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 75c3006..8369099 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -62,6 +62,43 @@ struct vcpu *__init alloc_dom0_vcpu0(void)
     return alloc_vcpu(dom0, 0, 0);
 }
 
+static int set_memory_reg_11(struct domain *d, struct kernel_info *kinfo,
+                             const void *fdt, const u32 *cell, int len,
+                             int address_cells, int size_cells, u32 *new_cell)
+{
+    int reg_size = (address_cells + size_cells) * sizeof(*cell);
+    paddr_t start;
+    paddr_t size;
+    struct page_info *pg;
+    unsigned int order = get_order_from_bytes(dom0_mem);
+    int res;
+    paddr_t spfn;
+
+    pg = alloc_domheap_pages(d, order, 0);
+    if ( !pg )
+        panic("Failed to allocate contiguous memory for dom0\n");
+
+    spfn = page_to_mfn(pg);
+    start = spfn << PAGE_SHIFT;
+    size = (1 << order) << PAGE_SHIFT;
+
+    // 1:1 mapping
+    printk("Populate P2M %#"PRIx64"->%#"PRIx64" (1:1 mapping for dom0)\n",
+           start, start + size);
+    res = guest_physmap_add_page(d, spfn, spfn, order);
+
+    if ( res )
+        panic("Unable to add pages in DOM0: %d\n", res);
+
+    device_tree_set_reg(&new_cell, address_cells, size_cells, start, size);
+
+    kinfo->mem.bank[0].start = start;
+    kinfo->mem.bank[0].size = size;
+    kinfo->mem.nr_banks = 1;
+
+    return reg_size;
+}
+
 static int set_memory_reg(struct domain *d, struct kernel_info *kinfo,
                           const void *fdt, const u32 *cell, int len,
                           int address_cells, int size_cells, u32 *new_cell)
@@ -71,6 +108,10 @@ static int set_memory_reg(struct domain *d, struct kernel_info *kinfo,
     u64 start;
     u64 size;
 
+    if ( platform_has_quirk(PLATFORM_QUIRK_DOM0_MAPPING_11) )
+        return set_memory_reg_11(d, kinfo, fdt, cell, len, address_cells,
+                                 size_cells, new_cell);
+
     while ( kinfo->unassigned_mem > 0 && l + reg_size <= len
             && kinfo->mem.nr_banks < NR_MEM_BANKS )
     {
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index e116265..f460e9c 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -28,6 +28,12 @@ struct platform_desc {
     uint32_t (*quirks)(void);
 };
 
+/*
+ * Quirk to map dom0 memory in 1:1
+ * Usefull on platform where System MMU is not yet implemented
+ */
+#define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
+
 int __init platform_init(void);
 int __init platform_init_time(void);
 int __init platform_specific_mapping(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6Ow-0004I3-3U; Tue, 14 May 2013 03:59:46 +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 1Uc6Ov-0004Hg-0I
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:45 +0000
Received: from [85.158.139.211:2777] by server-1.bemta-5.messagelabs.com id
	44/F1-01720-0B6B1915; Tue, 14 May 2013 03:59:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1368503982!22944757!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_32,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2020 invoked from network); 14 May 2013 03:59:43 -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;
	14 May 2013 03:59: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 1Uc6Os-0003G5-2m
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Os-0006aF-0G
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:42 +0000
Date: Tue, 14 May 2013 03:59:42 +0000
Message-Id: <E1Uc6Os-0006aF-0G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add versatile express platform
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 af99b3476642b67918c959c68f879201582de001
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 19:48:29 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Add versatile express platform
    
    This platform contains nearly nothing specific except the reset function.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/platforms/vexpress.c        |   40 ++++++++++++++++++++++++++++++
 xen/arch/arm/shutdown.c                  |   14 ----------
 xen/include/asm-arm/config.h             |    3 --
 xen/include/asm-arm/platforms/vexpress.h |    3 ++
 4 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c
index fd4ce74..8fc30c4 100644
--- a/xen/arch/arm/platforms/vexpress.c
+++ b/xen/arch/arm/platforms/vexpress.c
@@ -18,7 +18,9 @@
  */
 
 #include <asm/platforms/vexpress.h>
+#include <asm/platform.h>
 #include <xen/mm.h>
+#include <xen/vmap.h>
 
 #define DCC_SHIFT      26
 #define FUNCTION_SHIFT 20
@@ -91,6 +93,44 @@ out:
 }
 
 /*
+ * TODO: Get base address from the device tree
+ * See arm,vexpress-reset node
+ */
+static void vexpress_reset(void)
+{
+    void __iomem *sp810;
+
+    /* Use the SP810 system controller to force a reset */
+    sp810 = ioremap_nocache(SP810_ADDRESS, PAGE_SIZE);
+
+    if ( !sp810 )
+    {
+        dprintk(XENLOG_ERR, "Unable to map SP810\n");
+        return;
+    }
+
+    /* switch to slow mode */
+    iowritel(sp810, 0x3);
+    dsb(); isb();
+    /* writing any value to SCSYSSTAT reg will reset the system */
+    iowritel(sp810 + 4, 0x1);
+    dsb(); isb();
+
+    iounmap(sp810);
+}
+
+static const char const *vexpress_dt_compat[] __initdata =
+{
+    "arm,vexpress",
+    NULL
+};
+
+PLATFORM_START(vexpress, "VERSATILE EXPRESS")
+    .compatible = vexpress_dt_compat,
+    .reset = vexpress_reset,
+PLATFORM_END
+
+/*
  * Local variables:
  * mode: C
  * c-file-style: "BSD"
diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index 0903842..767cc12 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -3,25 +3,11 @@
 #include <xen/cpu.h>
 #include <xen/delay.h>
 #include <xen/lib.h>
-#include <xen/mm.h>
 #include <xen/smp.h>
 #include <asm/platform.h>
 
 static void raw_machine_reset(void)
 {
-    /* XXX get this from device tree */
-#ifdef SP810_ADDRESS
-    /* Use the SP810 system controller to force a reset */
-    volatile uint32_t *sp810;
-    set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
-    sp810 = ((uint32_t *)
-             (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK)));
-    sp810[0] = 0x3; /* switch to slow mode */
-    dsb(); isb();
-    sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */
-    dsb(); isb();
-    clear_fixmap(FIXMAP_MISC);
-#endif
     platform_reset();
 }
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 8ed72f5..7599202 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -149,9 +149,6 @@ extern unsigned long frametable_virt_end;
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
-/* Board-specific: base address of system controller */
-#define SP810_ADDRESS 0x1C020000
-
 
 #endif /* __ARM_CONFIG_H__ */
 /*
diff --git a/xen/include/asm-arm/platforms/vexpress.h b/xen/include/asm-arm/platforms/vexpress.h
index 67f8fef..5cf3aba 100644
--- a/xen/include/asm-arm/platforms/vexpress.h
+++ b/xen/include/asm-arm/platforms/vexpress.h
@@ -23,6 +23,9 @@
 #define V2M_SYS_CFG_OSC4      4
 #define V2M_SYS_CFG_OSC5      5
 
+/* Board-specific: base address of system controller */
+#define SP810_ADDRESS 0x1C020000
+
 #ifndef __ASSEMBLY__
 #include <xen/inttypes.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6Ow-0004I3-3U; Tue, 14 May 2013 03:59:46 +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 1Uc6Ov-0004Hg-0I
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:45 +0000
Received: from [85.158.139.211:2777] by server-1.bemta-5.messagelabs.com id
	44/F1-01720-0B6B1915; Tue, 14 May 2013 03:59:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1368503982!22944757!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_32,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2020 invoked from network); 14 May 2013 03:59:43 -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;
	14 May 2013 03:59: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 1Uc6Os-0003G5-2m
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Os-0006aF-0G
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:42 +0000
Date: Tue, 14 May 2013 03:59:42 +0000
Message-Id: <E1Uc6Os-0006aF-0G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add versatile express platform
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 af99b3476642b67918c959c68f879201582de001
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 19:48:29 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Add versatile express platform
    
    This platform contains nearly nothing specific except the reset function.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/platforms/vexpress.c        |   40 ++++++++++++++++++++++++++++++
 xen/arch/arm/shutdown.c                  |   14 ----------
 xen/include/asm-arm/config.h             |    3 --
 xen/include/asm-arm/platforms/vexpress.h |    3 ++
 4 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c
index fd4ce74..8fc30c4 100644
--- a/xen/arch/arm/platforms/vexpress.c
+++ b/xen/arch/arm/platforms/vexpress.c
@@ -18,7 +18,9 @@
  */
 
 #include <asm/platforms/vexpress.h>
+#include <asm/platform.h>
 #include <xen/mm.h>
+#include <xen/vmap.h>
 
 #define DCC_SHIFT      26
 #define FUNCTION_SHIFT 20
@@ -91,6 +93,44 @@ out:
 }
 
 /*
+ * TODO: Get base address from the device tree
+ * See arm,vexpress-reset node
+ */
+static void vexpress_reset(void)
+{
+    void __iomem *sp810;
+
+    /* Use the SP810 system controller to force a reset */
+    sp810 = ioremap_nocache(SP810_ADDRESS, PAGE_SIZE);
+
+    if ( !sp810 )
+    {
+        dprintk(XENLOG_ERR, "Unable to map SP810\n");
+        return;
+    }
+
+    /* switch to slow mode */
+    iowritel(sp810, 0x3);
+    dsb(); isb();
+    /* writing any value to SCSYSSTAT reg will reset the system */
+    iowritel(sp810 + 4, 0x1);
+    dsb(); isb();
+
+    iounmap(sp810);
+}
+
+static const char const *vexpress_dt_compat[] __initdata =
+{
+    "arm,vexpress",
+    NULL
+};
+
+PLATFORM_START(vexpress, "VERSATILE EXPRESS")
+    .compatible = vexpress_dt_compat,
+    .reset = vexpress_reset,
+PLATFORM_END
+
+/*
  * Local variables:
  * mode: C
  * c-file-style: "BSD"
diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index 0903842..767cc12 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -3,25 +3,11 @@
 #include <xen/cpu.h>
 #include <xen/delay.h>
 #include <xen/lib.h>
-#include <xen/mm.h>
 #include <xen/smp.h>
 #include <asm/platform.h>
 
 static void raw_machine_reset(void)
 {
-    /* XXX get this from device tree */
-#ifdef SP810_ADDRESS
-    /* Use the SP810 system controller to force a reset */
-    volatile uint32_t *sp810;
-    set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
-    sp810 = ((uint32_t *)
-             (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK)));
-    sp810[0] = 0x3; /* switch to slow mode */
-    dsb(); isb();
-    sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */
-    dsb(); isb();
-    clear_fixmap(FIXMAP_MISC);
-#endif
     platform_reset();
 }
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 8ed72f5..7599202 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -149,9 +149,6 @@ extern unsigned long frametable_virt_end;
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
-/* Board-specific: base address of system controller */
-#define SP810_ADDRESS 0x1C020000
-
 
 #endif /* __ARM_CONFIG_H__ */
 /*
diff --git a/xen/include/asm-arm/platforms/vexpress.h b/xen/include/asm-arm/platforms/vexpress.h
index 67f8fef..5cf3aba 100644
--- a/xen/include/asm-arm/platforms/vexpress.h
+++ b/xen/include/asm-arm/platforms/vexpress.h
@@ -23,6 +23,9 @@
 #define V2M_SYS_CFG_OSC4      4
 #define V2M_SYS_CFG_OSC5      5
 
+/* Board-specific: base address of system controller */
+#define SP810_ADDRESS 0x1C020000
+
 #ifndef __ASSEMBLY__
 #include <xen/inttypes.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6P6-0004Ju-6P; Tue, 14 May 2013 03:59:56 +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 1Uc6P4-0004JZ-Ln
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:54 +0000
Received: from [85.158.143.99:31038] by server-2.bemta-4.messagelabs.com id
	6D/ED-27124-AB6B1915; Tue, 14 May 2013 03:59:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368503992!28123028!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21532 invoked from network); 14 May 2013 03:59:53 -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;
	14 May 2013 03:59: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 1Uc6P2-0003GB-7z
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6P2-0006ab-62
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:52 +0000
Date: Tue, 14 May 2013 03:59:52 +0000
Message-Id: <E1Uc6P2-0006ab-62@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove request_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cc53cadedd7df047745175134ea228aae39c0ffe
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:18:29 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Remove request_irq
    
    All calls to this function in ARM code have been removed. This function SHOULD
    not be used. If someone calls this function, a linking error will occur.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index e83ad22..2fe4296 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -97,13 +97,6 @@ int __init request_dt_irq(const struct dt_irq *irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char *devname, void *dev_id)
 {
-    return request_irq(irq->irq, handler, irqflags, devname, dev_id);
-}
-
-int __init request_irq(unsigned int irq,
-        void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
-{
     struct irqaction *action;
     int retval;
 
@@ -113,7 +106,7 @@ int __init request_irq(unsigned int irq,
      * which interrupt is which (messes up the interrupt freeing
      * logic etc).
      */
-    if (irq >= nr_irqs)
+    if (irq->irq >= nr_irqs)
         return -EINVAL;
     if (!handler)
         return -EINVAL;
@@ -127,7 +120,7 @@ int __init request_irq(unsigned int irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_irq(irq, action);
+    retval = setup_dt_irq(irq, action);
     if (retval)
         xfree(action);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 03:59:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 03:59: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 1Uc6P6-0004Ju-6P; Tue, 14 May 2013 03:59:56 +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 1Uc6P4-0004JZ-Ln
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:54 +0000
Received: from [85.158.143.99:31038] by server-2.bemta-4.messagelabs.com id
	6D/ED-27124-AB6B1915; Tue, 14 May 2013 03:59:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368503992!28123028!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21532 invoked from network); 14 May 2013 03:59:53 -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;
	14 May 2013 03:59: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 1Uc6P2-0003GB-7z
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6P2-0006ab-62
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 03:59:52 +0000
Date: Tue, 14 May 2013 03:59:52 +0000
Message-Id: <E1Uc6P2-0006ab-62@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove request_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cc53cadedd7df047745175134ea228aae39c0ffe
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:18:29 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:00 2013 +0100

    xen/arm: Remove request_irq
    
    All calls to this function in ARM code have been removed. This function SHOULD
    not be used. If someone calls this function, a linking error will occur.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index e83ad22..2fe4296 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -97,13 +97,6 @@ int __init request_dt_irq(const struct dt_irq *irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char *devname, void *dev_id)
 {
-    return request_irq(irq->irq, handler, irqflags, devname, dev_id);
-}
-
-int __init request_irq(unsigned int irq,
-        void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
-{
     struct irqaction *action;
     int retval;
 
@@ -113,7 +106,7 @@ int __init request_irq(unsigned int irq,
      * which interrupt is which (messes up the interrupt freeing
      * logic etc).
      */
-    if (irq >= nr_irqs)
+    if (irq->irq >= nr_irqs)
         return -EINVAL;
     if (!handler)
         return -EINVAL;
@@ -127,7 +120,7 @@ int __init request_irq(unsigned int irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_irq(irq, action);
+    retval = setup_dt_irq(irq, action);
     if (retval)
         xfree(action);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00: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 1Uc6PG-0004Pj-AZ; Tue, 14 May 2013 04:00:06 +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 1Uc6PF-0004PY-Ey
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:05 +0000
Received: from [85.158.143.99:31345] by server-2.bemta-4.messagelabs.com id
	2B/FD-27124-4C6B1915; Tue, 14 May 2013 04:00:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368504003!28123043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21916 invoked from network); 14 May 2013 04:00:04 -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;
	14 May 2013 04:00: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 1Uc6PC-0003Mg-VQ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6PC-0006bK-Qt
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:02 +0000
Date: Tue, 14 May 2013 04:00:02 +0000
Message-Id: <E1Uc6PC-0006bK-Qt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove setup_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 237c94508b149af506e20dd1ad8bcd57b49201f9
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:20:38 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Remove setup_irq
    
    All calls to this function in ARM code have been removed. This function SHOULD
    not be used. If someone calls this function, a linking error will occur.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index c7ff21c..30bf8d1 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -557,20 +557,15 @@ static int __setup_irq(struct irq_desc *desc, unsigned int irq,
 
 int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
 {
-    return setup_irq(irq->irq, new);
-}
-
-int __init setup_irq(unsigned int irq, struct irqaction *new)
-{
     int rc;
     unsigned long flags;
     struct irq_desc *desc;
 
-    desc = irq_to_desc(irq);
+    desc = irq_to_desc(irq->irq);
 
     spin_lock_irqsave(&desc->lock, flags);
 
-    rc = __setup_irq(desc, irq, new);
+    rc = __setup_irq(desc, irq->irq, new);
 
     spin_unlock_irqrestore(&desc->lock, flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00: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 1Uc6PG-0004Pj-AZ; Tue, 14 May 2013 04:00:06 +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 1Uc6PF-0004PY-Ey
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:05 +0000
Received: from [85.158.143.99:31345] by server-2.bemta-4.messagelabs.com id
	2B/FD-27124-4C6B1915; Tue, 14 May 2013 04:00:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368504003!28123043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21916 invoked from network); 14 May 2013 04:00:04 -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;
	14 May 2013 04:00: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 1Uc6PC-0003Mg-VQ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6PC-0006bK-Qt
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:02 +0000
Date: Tue, 14 May 2013 04:00:02 +0000
Message-Id: <E1Uc6PC-0006bK-Qt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove setup_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 237c94508b149af506e20dd1ad8bcd57b49201f9
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 8 00:20:38 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Remove setup_irq
    
    All calls to this function in ARM code have been removed. This function SHOULD
    not be used. If someone calls this function, a linking error will occur.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index c7ff21c..30bf8d1 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -557,20 +557,15 @@ static int __setup_irq(struct irq_desc *desc, unsigned int irq,
 
 int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
 {
-    return setup_irq(irq->irq, new);
-}
-
-int __init setup_irq(unsigned int irq, struct irqaction *new)
-{
     int rc;
     unsigned long flags;
     struct irq_desc *desc;
 
-    desc = irq_to_desc(irq);
+    desc = irq_to_desc(irq->irq);
 
     spin_lock_irqsave(&desc->lock, flags);
 
-    rc = __setup_irq(desc, irq, new);
+    rc = __setup_irq(desc, irq->irq, new);
 
     spin_unlock_irqrestore(&desc->lock, flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00: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 1Uc6PT-0004Rg-Dc; Tue, 14 May 2013 04:00: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 1Uc6PR-0004RS-Qq
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:18 +0000
Received: from [85.158.139.83:58976] by server-2.bemta-5.messagelabs.com id
	D9/70-26552-0D6B1915; Tue, 14 May 2013 04:00:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1368504013!25385337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19827 invoked from network); 14 May 2013 04:00:14 -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;
	14 May 2013 04:00: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 1Uc6PN-0003Mn-BD
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6PN-0006cc-8r
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:13 +0000
Date: Tue, 14 May 2013 04:00:13 +0000
Message-Id: <E1Uc6PN-0006cc-8r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't use pl011 UART by
	default for early printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 53a0714c81b1584f1fe41e13b1a05dca632f6509
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 20:14:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Don't use pl011 UART by default for early printk
    
    Add CONFIG_EARLY_PRINTK options in configs/arm{32,64}.mk to let the user
    to choose if he wants to have early output, ie before the console is initialized.
    
    This code is specific for each UART. When CONFIG_EARLY_PRINTK is enabled,
    Xen will only be able to run on a board with this UART.
    
    If a developper wants to add support for a new UART, he must implement the
    following assembly macro/define:
       - EALY_UART_BASE_ADDRESS: variable which contains the physical base address
       for the UART
       - early_uart_init: initialize the UART
       - early_uart_ready: check and wait until the UART can transmit a new
       character
       - early_uart_transmit: transmit a character
    
    For more details about the parameters of each function,
    see arm{32,64}/debug-pl011.inc comments.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt     |   14 +++++++
 xen/arch/arm/Makefile              |    2 +-
 xen/arch/arm/Rules.mk              |   18 +++++++++
 xen/arch/arm/arm32/Makefile        |    4 ++-
 xen/arch/arm/arm32/debug-pl011.inc |   58 ++++++++++++++++++++++++++++++
 xen/arch/arm/arm32/debug.S         |   33 +++++++++++++++++
 xen/arch/arm/arm32/head.S          |   65 ++++++++++++++++-----------------
 xen/arch/arm/arm64/Makefile        |    2 +
 xen/arch/arm/arm64/debug-pl011.inc |   59 ++++++++++++++++++++++++++++++
 xen/arch/arm/arm64/debug.S         |   33 +++++++++++++++++
 xen/arch/arm/arm64/head.S          |   69 ++++++++++++++++--------------------
 xen/arch/arm/early_printk.c        |   16 +--------
 xen/include/asm-arm/config.h       |    2 -
 xen/include/asm-arm/early_printk.h |    2 +-
 14 files changed, 285 insertions(+), 92 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
new file mode 100644
index 0000000..4065811
--- /dev/null
+++ b/docs/misc/arm/early-printk.txt
@@ -0,0 +1,14 @@
+How to enable early printk
+
+Early printk can only be enabled if debug=y. You may want to enable it if
+you are debbuging code that executes before the console is initialized.
+
+Note that selecting this option will limit Xen to a single UART definition.
+Attempting to boot Xen image on a different platform *will not work*, so this
+option should not be enable for Xens that are intended to be portable.
+
+CONFIG_EARLY_PRINTK=mach
+where mach is the name of the machine:
+  - vexpress: printk with pl011 for versatile express
+
+By default early printk is disabled.
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 2717f26..87fabe1 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -2,7 +2,7 @@ subdir-$(arm32) += arm32
 subdir-$(arm64) += arm64
 subdir-y += platforms
 
-obj-y += early_printk.o
+obj-$(EARLY_PRINTK) += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
 obj-y += psci.o
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index a0a14e0..297385b 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -36,3 +36,21 @@ endif
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
+
+EARLY_PRINTK := n
+
+ifeq ($(debug),y)
+
+# Early printk for versatile express
+# TODO handle UART base address from make command line
+ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
+EARLY_PRINTK_INC := pl011
+endif
+
+ifneq ($(EARLY_PRINTK_INC),)
+EARLY_PRINTK := y
+endif
+
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
+endif
diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 1ad3364..aaf277a 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -5,4 +5,6 @@ obj-y += mode_switch.o
 obj-y += proc-ca15.o
 
 obj-y += traps.o
-obj-y += domain.o
\ No newline at end of file
+obj-y += domain.o
+
+obj-$(EARLY_PRINTK) += debug.o
diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc
new file mode 100644
index 0000000..6954aeb
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -0,0 +1,58 @@
+/*
+ * xen/arch/arm/arm32/debug-pl011.inc
+ *
+ * PL011 specific debug code
+ *
+ * Copyright (c) 2013 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.
+ */
+
+#define EARLY_UART_BASE_ADDRESS 0x1c090000
+
+/* PL011 UART initialization
+ * rb: register which contains the UART base address
+ * rc: scratch register 1
+ * rd: scratch register 2 (unused here) */
+.macro early_uart_init rb, rc, rd
+        mov   \rc, #0x0
+        str   \rc, [\rb, #0x28]     /* -> UARTFBRD (Baud divisor fraction) */
+        mov   \rc, #0x4             /* 7.3728MHz / 0x4 == 16 * 115200 */
+        str   \rc, [\rb, #0x24]     /* -> UARTIBRD (Baud divisor integer) */
+        mov   \rc, #0x60            /* 8n1 */
+        str   \rc, [\rb, #0x2C]     /* -> UARTLCR_H (Line control) */
+        ldr   \rc, =0x00000301      /* RXE | TXE | UARTEN */
+        str   \rc, [\rb, #0x30]     /* -> UARTCR (Control Register) */
+.endm
+
+/* PL011 UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register */
+.macro early_uart_ready rb, rc
+1:
+        ldr   \rc, [\rb, #0x18]     /* <- UARTFR (Flag register) */
+        tst   \rc, #0x8             /* Check BUSY bit */
+        bne   1b                    /* Wait for the UART to be ready */
+.endm
+
+/* PL011 UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit */
+.macro early_uart_transmit rb, rt
+        str   \rt, [\rb]            /* -> UARTDR (Data Register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm32/debug.S b/xen/arch/arm/arm32/debug.S
new file mode 100644
index 0000000..09e5cae
--- /dev/null
+++ b/xen/arch/arm/arm32/debug.S
@@ -0,0 +1,33 @@
+/*
+ * xen/arch/arm/arm32/debug.S
+ *
+ * Wrapper for early printk
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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>
+
+#ifdef EARLY_PRINTK_INC
+#include EARLY_PRINTK_INC
+#endif
+
+.globl early_putch
+/* Print a character on the UART - this function is called by C
+ * r0: character to print */
+early_putch:
+        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* r1 := VA UART base address */
+        early_uart_ready r1, r2
+        early_uart_transmit r1, r0
+        mov   pc, lr
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 0b4cfde..d452b59 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -32,9 +32,13 @@
 #define PT_UPPER(x) (PT_##x & 0xf00)
 #define PT_LOWER(x) (PT_##x & 0x0ff)
 
+#if (defined (EARLY_PRINTK)) && (defined (EARLY_PRINTK_INC))
+#include EARLY_PRINTK_INC
+#endif
+
 /* Macro to print a string to the UART, if there is one.
  * Clobbers r0-r3. */
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
 #define PRINT(_s)       \
         adr   r0, 98f ; \
         bl    puts    ; \
@@ -42,9 +46,9 @@
 98:     .asciz _s     ; \
         .align 2      ; \
 99:
-#else
+#else /* EARLY_PRINTK */
 #define PRINT(s)
-#endif
+#endif /* !EARLY_PRINTK */
 
         .arm
 
@@ -106,8 +110,8 @@ past_zImage:
         bne   1b
 
 boot_cpu:
-#ifdef EARLY_UART_ADDRESS
-        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
+#ifdef EARLY_PRINTK
+        ldr   r11, =EARLY_UART_BASE_ADDRESS  /* r11 := UART base address */
         teq   r12, #0                   /* CPU 0 sets up the UART too */
         bleq  init_uart
         PRINT("- CPU ")
@@ -216,7 +220,7 @@ skip_bss:
         bne   pt_ready
 
         /* console fixmap */
-#ifdef EARLY_UART_ADDRESS
+#if defined(EARLY_PRINTK)
         ldr   r1, =xen_fixmap
         add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
         mov   r3, #0
@@ -279,7 +283,7 @@ pt_ready:
 paging:
 
 
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
         /* Use a virtual address to access the UART. */
         ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 #endif
@@ -345,49 +349,42 @@ fail:   PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
 
-#ifdef EARLY_UART_ADDRESS
 
-/* Bring up the UART. Specific to the PL011 UART.
+#ifdef EARLY_PRINTK
+/* Bring up the UART.
+ * r11: Early UART base address
  * Clobbers r0-r2 */
 init_uart:
-        mov   r1, #0x0
-        str   r1, [r11, #0x28]       /* -> UARTFBRD (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, #0x2C]       /* -> UARTLCR_H (Line control) */
-        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
-        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
+        early_uart_init r11, r1, r2
         adr   r0, 1f
-        b     puts
+        b     puts                  /* Jump to puts */
 1:      .asciz "- UART enabled -\r\n"
         .align 4
 
-/* Print early debug messages.  Specific to the PL011 UART.
+/* Print early debug messages.
  * r0: Nul-terminated string to print.
- * Clobbers r0-r2 */
+ * r11: Early UART base address
+ * Clobbers r0-r1 */
 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 */
+        early_uart_ready r11, r1
+        ldrb  r1, [r0], #1           /* Load next char */
+        teq   r1, #0                 /* Exit on nul */
         moveq pc, lr
-        str   r2, [r11]              /* -> UARTDR (Data Register) */
-        b     puts
+        early_uart_transmit r11, r1
+        b puts
 
 /* Print a 32-bit number in hex.  Specific to the PL011 UART.
  * r0: Number to print.
- * clobbers r0-r3 */
+ * r11: Early UART base address
+ * 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 */
+1:
+        early_uart_ready r11, r2
         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) */
+        early_uart_transmit r11, r2
         lsl   r0, #4                 /* Roll it through one nybble at a time */
         subs  r3, r3, #1
         bne   1b
@@ -396,7 +393,7 @@ putn:
 hex:    .ascii "0123456789abcdef"
         .align 2
 
-#else  /* EARLY_UART_ADDRESS */
+#else  /* EARLY_PRINTK */
 
 init_uart:
 .global early_puts
@@ -404,7 +401,7 @@ early_puts:
 puts:
 putn:   mov   pc, lr
 
-#endif /* EARLY_UART_ADDRESS */
+#endif /* !EARLY_PRINTK */
 
 /*
  * Local variables:
diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
index be41f43..9484548 100644
--- a/xen/arch/arm/arm64/Makefile
+++ b/xen/arch/arm/arm64/Makefile
@@ -5,3 +5,5 @@ obj-y += mode_switch.o
 
 obj-y += traps.o
 obj-y += domain.o
+
+obj-$(EARLY_PRINTK) += debug.o
diff --git a/xen/arch/arm/arm64/debug-pl011.inc b/xen/arch/arm/arm64/debug-pl011.inc
new file mode 100644
index 0000000..ee6e0e0
--- /dev/null
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -0,0 +1,59 @@
+/*
+ * xen/arch/arm/arm64/debug-pl011.S
+ *
+ * PL011 specific debug code
+ *
+ * Copyright (c) 2013 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>
+
+#define EARLY_UART_BASE_ADDRESS 0x1c090000
+
+/* PL011 UART initialization
+ * xb: register which containts the UART base address
+ * c: scratch register number */
+.macro early_uart_init xb, c
+        mov   x\c, #0x0
+        strh  w\c, [\xb, #0x28]      /* -> UARTFBRD (Baud divisor fraction) */
+        mov   x\c, #0x4              /* 7.3728MHz / 0x4 == 16 * 115200 */
+        strh  w\c, [\xb, #0x24]      /* -> UARTIBRD (Baud divisor integer) */
+        mov   x\c, #0x60             /* 8n1 */
+        str   w\c, [\xb, #0x2C]      /* -> UARTLCR_H (Line control) */
+        ldr   x\c, =0x00000301       /* RXE | TXE | UARTEN */
+        str   w\c, [\xb, #0x30]      /* -> UARTCR (Control Register) */
+.endm
+
+/* PL011 UART wait UART to be ready to transmit
+ * xb: register which contains the UART base address
+ * c: scratch register number */
+.macro early_uart_ready xb, c
+1:
+        ldrh  w\c, [\xb, #0x18]      /* <- UARTFR (Flag register) */
+        tst   w\c, #0x8              /* Check BUSY bit */
+        b.ne  1b                     /* Wait for the UART to be ready */
+.endm
+
+/* PL011 UART transmit character
+ * xb: register which contains the UART base address
+ * wt: register which contains the character to transmit */
+.macro early_uart_transmit xb, wt
+        strb  \wt, [\xb]             /* -> UARTDR (Data Register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
new file mode 100644
index 0000000..48a6567
--- /dev/null
+++ b/xen/arch/arm/arm64/debug.S
@@ -0,0 +1,33 @@
+/*
+ * xen/arch/arm/arm64/debug.S
+ *
+ * Wrapper for early printk
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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>
+
+#ifdef EARLY_PRINTK_INC
+#include EARLY_PRINTK_INC
+#endif
+
+.globl early_putch
+/* Print a character on the UART - this function is called by C
+ * x0: character to print */
+early_putch:
+        ldr   x23, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+        early_uart_ready x23, 1
+        early_uart_transmit x23, w0
+        ret
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index ef02899..79a8da9 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -29,9 +29,13 @@
 #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 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=1 P=1 */
 
+#if (defined (EARLY_PRINTK)) && (defined (EARLY_PRINTK_INC))
+#include EARLY_PRINTK_INC
+#endif
+
 /* Macro to print a string to the UART, if there is one.
- * Clobbers r0-r3. */
-#ifdef EARLY_UART_ADDRESS
+ * Clobbers x0-x3. */
+#ifdef EARLY_PRINTK
 #define PRINT(_s)       \
         adr   x0, 98f ; \
         bl    puts    ; \
@@ -39,9 +43,9 @@
 98:     .asciz _s     ; \
         .align 2      ; \
 99:
-#else
+#else /* EARLY_PRINTK */
 #define PRINT(s)
-#endif
+#endif /* !EARLY_PRINTK */
 
         /*.aarch64*/
 
@@ -109,8 +113,8 @@ real_start:
 2:
 
 boot_cpu:
-#ifdef EARLY_UART_ADDRESS
-        ldr   x23, =EARLY_UART_ADDRESS  /* x23 := UART base address */
+#ifdef EARLY_PRINTK
+        ldr   x23, =EARLY_UART_BASE_ADDRESS /* x23 := UART base address */
         cbnz  x22, 1f
         bl    init_uart                 /* CPU 0 sets up the UART too */
 1:      PRINT("- CPU ")
@@ -206,7 +210,6 @@ skip_bss:
         mov   x4, x1                 /* Next level into xen_first */
 
        /* console fixmap */
-#ifdef EARLY_UART_ADDRESS
         ldr   x1, =xen_fixmap
         add   x1, x1, x20            /* x1 := paddr (xen_fixmap) */
         lsr   x2, x23, #12
@@ -214,7 +217,6 @@ skip_bss:
         mov   x3, #PT_DEV_L3
         orr   x2, x2, x3             /* x2 := 4K dev map including UART */
         str   x2, [x1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
-#endif
 
         /* Build the baseline idle pagetable's first-level entries */
         ldr   x1, =xen_second
@@ -266,10 +268,8 @@ pt_ready:
         br    x1                     /* Get a proper vaddr into PC */
 paging:
 
-#ifdef EARLY_UART_ADDRESS
         /* Use a virtual address to access the UART. */
         ldr   x23, =FIXMAP_ADDR(FIXMAP_CONSOLE)
-#endif
 
         PRINT("- Ready -\r\n")
 
@@ -329,51 +329,44 @@ fail:   PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
 
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
 
-/* Bring up the UART. Specific to the PL011 UART.
- * Clobbers r0-r2 */
+/* Bring up the UART.
+ * x23: Early UART base address
+ * Clobbers x0-x1 */
 init_uart:
-        mov   x1, #0x0
-        strh  w1, [x23, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
-        mov   x1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
-        strh  w1, [x23, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
-        mov   x1, #0x60              /* 8n1 */
-        strh  w1, [x23, #0x24]       /* -> UARTLCR_H (Line control) */
-        ldr   x1, =0x00000301        /* RXE | TXE | UARTEN */
-        strh  w1, [x23, #0x30]       /* -> UARTCR (Control Register) */
+        early_uart_init x23, 0
         adr   x0, 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 */
+/* Print early debug messages.
+ * x0: Nul-terminated string to print.
+ * x23: Early UART base address
+ * Clobbers x0-x1 */
 puts:
-        ldrh  w2, [x23, #0x18]       /* <- UARTFR (Flag register) */
-        tst   w2, #0x8               /* Check BUSY bit */
-        b.ne  puts                   /* Wait for the UART to be ready */
-        ldrb  w2, [x0], #1           /* Load next char */
-        cbz   w2, 1f                 /* Exit on nul */
-        str   w2, [x23]              /* -> UARTDR (Data Register) */
+        early_uart_ready x23, 1
+        ldrb  w1, [x0], #1           /* Load next char */
+        cbz   w1, 1f                 /* Exit on nul */
+        early_uart_transmit x23, w1
         b     puts
 1:
         ret
 
 /* Print a 32-bit number in hex.  Specific to the PL011 UART.
- * r0: Number to print.
- * clobbers r0-r3 */
+ * x0: Number to print.
+ * x23: Early UART base address
+ * Clobbers x0-x3 */
 putn:
         adr   x1, hex
         mov   x3, #8
-1:      ldrh  w2, [x23, #0x18]       /* <- UARTFR (Flag register) */
-        tst   w2, #0x8               /* Check BUSY bit */
-        b.ne  1b                     /* Wait for the UART to be ready */
+1:
+        early_uart_ready x23, 2
         and   x2, x0, #0xf0000000    /* Mask off the top nybble */
         lsr   x2, x2, #28
         ldrb  w2, [x1, x2]           /* Convert to a char */
-        strb  w2, [x23]              /* -> UARTDR (Data Register) */
+        early_uart_transmit x23, w2
         lsl   x0, x0, #4             /* Roll it through one nybble at a time */
         subs  x3, x3, #1
         b.ne  1b
@@ -382,7 +375,7 @@ putn:
 hex:    .ascii "0123456789abcdef"
         .align 2
 
-#else  /* EARLY_UART_ADDRESS */
+#else  /* EARLY_PRINTK */
 
 init_uart:
 .global early_puts
@@ -390,4 +383,4 @@ early_puts:
 puts:
 putn:   ret
 
-#endif /* EARLY_UART_ADDRESS */
+#endif /* EARLY_PRINTK */
diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 0f99a43..5950323 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -15,19 +15,7 @@
 #include <xen/string.h>
 #include <asm/early_printk.h>
 
-#ifdef EARLY_UART_ADDRESS
-
-void __init early_putch(char c)
-{
-    volatile uint32_t *r;
-
-    r = (uint32_t *)(XEN_VIRT_START + (1 << 21));
-
-    /* XXX: assuming a PL011 UART. */
-    while(*(r + 0x6) & 0x8)
-        ;
-    *r = c;
-}
+void early_putch(char c);
 
 /* Early printk buffer */
 static char __initdata buf[512];
@@ -68,5 +56,3 @@ early_panic(const char *fmt, ...)
 
     while(1);
 }
-
-#endif /* #ifdef EARLY_UART_ADDRESS */
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 7599202..6414c89 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -141,8 +141,6 @@ extern unsigned long frametable_virt_end;
 #define watchdog_disable() ((void)0)
 #define watchdog_enable()  ((void)0)
 
-/* Board-specific: base address of PL011 UART */
-#define EARLY_UART_ADDRESS 0x1c090000
 /* Board-specific: base address of GIC + its regs */
 #define GIC_BASE_ADDRESS 0x2c000000
 #define GIC_DR_OFFSET 0x1000
diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index a0297a7..b72fce7 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -12,7 +12,7 @@
 
 #include <xen/config.h>
 
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
 
 void early_printk(const char *fmt, ...);
 void early_panic(const char *fmt, ...) __attribute__((noreturn));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00: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 1Uc6PT-0004Rg-Dc; Tue, 14 May 2013 04:00: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 1Uc6PR-0004RS-Qq
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:18 +0000
Received: from [85.158.139.83:58976] by server-2.bemta-5.messagelabs.com id
	D9/70-26552-0D6B1915; Tue, 14 May 2013 04:00:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1368504013!25385337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19827 invoked from network); 14 May 2013 04:00:14 -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;
	14 May 2013 04:00: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 1Uc6PN-0003Mn-BD
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6PN-0006cc-8r
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:13 +0000
Date: Tue, 14 May 2013 04:00:13 +0000
Message-Id: <E1Uc6PN-0006cc-8r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Don't use pl011 UART by
	default for early printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 53a0714c81b1584f1fe41e13b1a05dca632f6509
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 20:14:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Don't use pl011 UART by default for early printk
    
    Add CONFIG_EARLY_PRINTK options in configs/arm{32,64}.mk to let the user
    to choose if he wants to have early output, ie before the console is initialized.
    
    This code is specific for each UART. When CONFIG_EARLY_PRINTK is enabled,
    Xen will only be able to run on a board with this UART.
    
    If a developper wants to add support for a new UART, he must implement the
    following assembly macro/define:
       - EALY_UART_BASE_ADDRESS: variable which contains the physical base address
       for the UART
       - early_uart_init: initialize the UART
       - early_uart_ready: check and wait until the UART can transmit a new
       character
       - early_uart_transmit: transmit a character
    
    For more details about the parameters of each function,
    see arm{32,64}/debug-pl011.inc comments.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt     |   14 +++++++
 xen/arch/arm/Makefile              |    2 +-
 xen/arch/arm/Rules.mk              |   18 +++++++++
 xen/arch/arm/arm32/Makefile        |    4 ++-
 xen/arch/arm/arm32/debug-pl011.inc |   58 ++++++++++++++++++++++++++++++
 xen/arch/arm/arm32/debug.S         |   33 +++++++++++++++++
 xen/arch/arm/arm32/head.S          |   65 ++++++++++++++++-----------------
 xen/arch/arm/arm64/Makefile        |    2 +
 xen/arch/arm/arm64/debug-pl011.inc |   59 ++++++++++++++++++++++++++++++
 xen/arch/arm/arm64/debug.S         |   33 +++++++++++++++++
 xen/arch/arm/arm64/head.S          |   69 ++++++++++++++++--------------------
 xen/arch/arm/early_printk.c        |   16 +--------
 xen/include/asm-arm/config.h       |    2 -
 xen/include/asm-arm/early_printk.h |    2 +-
 14 files changed, 285 insertions(+), 92 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
new file mode 100644
index 0000000..4065811
--- /dev/null
+++ b/docs/misc/arm/early-printk.txt
@@ -0,0 +1,14 @@
+How to enable early printk
+
+Early printk can only be enabled if debug=y. You may want to enable it if
+you are debbuging code that executes before the console is initialized.
+
+Note that selecting this option will limit Xen to a single UART definition.
+Attempting to boot Xen image on a different platform *will not work*, so this
+option should not be enable for Xens that are intended to be portable.
+
+CONFIG_EARLY_PRINTK=mach
+where mach is the name of the machine:
+  - vexpress: printk with pl011 for versatile express
+
+By default early printk is disabled.
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 2717f26..87fabe1 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -2,7 +2,7 @@ subdir-$(arm32) += arm32
 subdir-$(arm64) += arm64
 subdir-y += platforms
 
-obj-y += early_printk.o
+obj-$(EARLY_PRINTK) += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
 obj-y += psci.o
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index a0a14e0..297385b 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -36,3 +36,21 @@ endif
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
+
+EARLY_PRINTK := n
+
+ifeq ($(debug),y)
+
+# Early printk for versatile express
+# TODO handle UART base address from make command line
+ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
+EARLY_PRINTK_INC := pl011
+endif
+
+ifneq ($(EARLY_PRINTK_INC),)
+EARLY_PRINTK := y
+endif
+
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
+endif
diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 1ad3364..aaf277a 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -5,4 +5,6 @@ obj-y += mode_switch.o
 obj-y += proc-ca15.o
 
 obj-y += traps.o
-obj-y += domain.o
\ No newline at end of file
+obj-y += domain.o
+
+obj-$(EARLY_PRINTK) += debug.o
diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc
new file mode 100644
index 0000000..6954aeb
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -0,0 +1,58 @@
+/*
+ * xen/arch/arm/arm32/debug-pl011.inc
+ *
+ * PL011 specific debug code
+ *
+ * Copyright (c) 2013 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.
+ */
+
+#define EARLY_UART_BASE_ADDRESS 0x1c090000
+
+/* PL011 UART initialization
+ * rb: register which contains the UART base address
+ * rc: scratch register 1
+ * rd: scratch register 2 (unused here) */
+.macro early_uart_init rb, rc, rd
+        mov   \rc, #0x0
+        str   \rc, [\rb, #0x28]     /* -> UARTFBRD (Baud divisor fraction) */
+        mov   \rc, #0x4             /* 7.3728MHz / 0x4 == 16 * 115200 */
+        str   \rc, [\rb, #0x24]     /* -> UARTIBRD (Baud divisor integer) */
+        mov   \rc, #0x60            /* 8n1 */
+        str   \rc, [\rb, #0x2C]     /* -> UARTLCR_H (Line control) */
+        ldr   \rc, =0x00000301      /* RXE | TXE | UARTEN */
+        str   \rc, [\rb, #0x30]     /* -> UARTCR (Control Register) */
+.endm
+
+/* PL011 UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register */
+.macro early_uart_ready rb, rc
+1:
+        ldr   \rc, [\rb, #0x18]     /* <- UARTFR (Flag register) */
+        tst   \rc, #0x8             /* Check BUSY bit */
+        bne   1b                    /* Wait for the UART to be ready */
+.endm
+
+/* PL011 UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit */
+.macro early_uart_transmit rb, rt
+        str   \rt, [\rb]            /* -> UARTDR (Data Register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm32/debug.S b/xen/arch/arm/arm32/debug.S
new file mode 100644
index 0000000..09e5cae
--- /dev/null
+++ b/xen/arch/arm/arm32/debug.S
@@ -0,0 +1,33 @@
+/*
+ * xen/arch/arm/arm32/debug.S
+ *
+ * Wrapper for early printk
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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>
+
+#ifdef EARLY_PRINTK_INC
+#include EARLY_PRINTK_INC
+#endif
+
+.globl early_putch
+/* Print a character on the UART - this function is called by C
+ * r0: character to print */
+early_putch:
+        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* r1 := VA UART base address */
+        early_uart_ready r1, r2
+        early_uart_transmit r1, r0
+        mov   pc, lr
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 0b4cfde..d452b59 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -32,9 +32,13 @@
 #define PT_UPPER(x) (PT_##x & 0xf00)
 #define PT_LOWER(x) (PT_##x & 0x0ff)
 
+#if (defined (EARLY_PRINTK)) && (defined (EARLY_PRINTK_INC))
+#include EARLY_PRINTK_INC
+#endif
+
 /* Macro to print a string to the UART, if there is one.
  * Clobbers r0-r3. */
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
 #define PRINT(_s)       \
         adr   r0, 98f ; \
         bl    puts    ; \
@@ -42,9 +46,9 @@
 98:     .asciz _s     ; \
         .align 2      ; \
 99:
-#else
+#else /* EARLY_PRINTK */
 #define PRINT(s)
-#endif
+#endif /* !EARLY_PRINTK */
 
         .arm
 
@@ -106,8 +110,8 @@ past_zImage:
         bne   1b
 
 boot_cpu:
-#ifdef EARLY_UART_ADDRESS
-        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
+#ifdef EARLY_PRINTK
+        ldr   r11, =EARLY_UART_BASE_ADDRESS  /* r11 := UART base address */
         teq   r12, #0                   /* CPU 0 sets up the UART too */
         bleq  init_uart
         PRINT("- CPU ")
@@ -216,7 +220,7 @@ skip_bss:
         bne   pt_ready
 
         /* console fixmap */
-#ifdef EARLY_UART_ADDRESS
+#if defined(EARLY_PRINTK)
         ldr   r1, =xen_fixmap
         add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
         mov   r3, #0
@@ -279,7 +283,7 @@ pt_ready:
 paging:
 
 
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
         /* Use a virtual address to access the UART. */
         ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 #endif
@@ -345,49 +349,42 @@ fail:   PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
 
-#ifdef EARLY_UART_ADDRESS
 
-/* Bring up the UART. Specific to the PL011 UART.
+#ifdef EARLY_PRINTK
+/* Bring up the UART.
+ * r11: Early UART base address
  * Clobbers r0-r2 */
 init_uart:
-        mov   r1, #0x0
-        str   r1, [r11, #0x28]       /* -> UARTFBRD (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, #0x2C]       /* -> UARTLCR_H (Line control) */
-        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
-        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
+        early_uart_init r11, r1, r2
         adr   r0, 1f
-        b     puts
+        b     puts                  /* Jump to puts */
 1:      .asciz "- UART enabled -\r\n"
         .align 4
 
-/* Print early debug messages.  Specific to the PL011 UART.
+/* Print early debug messages.
  * r0: Nul-terminated string to print.
- * Clobbers r0-r2 */
+ * r11: Early UART base address
+ * Clobbers r0-r1 */
 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 */
+        early_uart_ready r11, r1
+        ldrb  r1, [r0], #1           /* Load next char */
+        teq   r1, #0                 /* Exit on nul */
         moveq pc, lr
-        str   r2, [r11]              /* -> UARTDR (Data Register) */
-        b     puts
+        early_uart_transmit r11, r1
+        b puts
 
 /* Print a 32-bit number in hex.  Specific to the PL011 UART.
  * r0: Number to print.
- * clobbers r0-r3 */
+ * r11: Early UART base address
+ * 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 */
+1:
+        early_uart_ready r11, r2
         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) */
+        early_uart_transmit r11, r2
         lsl   r0, #4                 /* Roll it through one nybble at a time */
         subs  r3, r3, #1
         bne   1b
@@ -396,7 +393,7 @@ putn:
 hex:    .ascii "0123456789abcdef"
         .align 2
 
-#else  /* EARLY_UART_ADDRESS */
+#else  /* EARLY_PRINTK */
 
 init_uart:
 .global early_puts
@@ -404,7 +401,7 @@ early_puts:
 puts:
 putn:   mov   pc, lr
 
-#endif /* EARLY_UART_ADDRESS */
+#endif /* !EARLY_PRINTK */
 
 /*
  * Local variables:
diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
index be41f43..9484548 100644
--- a/xen/arch/arm/arm64/Makefile
+++ b/xen/arch/arm/arm64/Makefile
@@ -5,3 +5,5 @@ obj-y += mode_switch.o
 
 obj-y += traps.o
 obj-y += domain.o
+
+obj-$(EARLY_PRINTK) += debug.o
diff --git a/xen/arch/arm/arm64/debug-pl011.inc b/xen/arch/arm/arm64/debug-pl011.inc
new file mode 100644
index 0000000..ee6e0e0
--- /dev/null
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -0,0 +1,59 @@
+/*
+ * xen/arch/arm/arm64/debug-pl011.S
+ *
+ * PL011 specific debug code
+ *
+ * Copyright (c) 2013 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>
+
+#define EARLY_UART_BASE_ADDRESS 0x1c090000
+
+/* PL011 UART initialization
+ * xb: register which containts the UART base address
+ * c: scratch register number */
+.macro early_uart_init xb, c
+        mov   x\c, #0x0
+        strh  w\c, [\xb, #0x28]      /* -> UARTFBRD (Baud divisor fraction) */
+        mov   x\c, #0x4              /* 7.3728MHz / 0x4 == 16 * 115200 */
+        strh  w\c, [\xb, #0x24]      /* -> UARTIBRD (Baud divisor integer) */
+        mov   x\c, #0x60             /* 8n1 */
+        str   w\c, [\xb, #0x2C]      /* -> UARTLCR_H (Line control) */
+        ldr   x\c, =0x00000301       /* RXE | TXE | UARTEN */
+        str   w\c, [\xb, #0x30]      /* -> UARTCR (Control Register) */
+.endm
+
+/* PL011 UART wait UART to be ready to transmit
+ * xb: register which contains the UART base address
+ * c: scratch register number */
+.macro early_uart_ready xb, c
+1:
+        ldrh  w\c, [\xb, #0x18]      /* <- UARTFR (Flag register) */
+        tst   w\c, #0x8              /* Check BUSY bit */
+        b.ne  1b                     /* Wait for the UART to be ready */
+.endm
+
+/* PL011 UART transmit character
+ * xb: register which contains the UART base address
+ * wt: register which contains the character to transmit */
+.macro early_uart_transmit xb, wt
+        strb  \wt, [\xb]             /* -> UARTDR (Data Register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
new file mode 100644
index 0000000..48a6567
--- /dev/null
+++ b/xen/arch/arm/arm64/debug.S
@@ -0,0 +1,33 @@
+/*
+ * xen/arch/arm/arm64/debug.S
+ *
+ * Wrapper for early printk
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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>
+
+#ifdef EARLY_PRINTK_INC
+#include EARLY_PRINTK_INC
+#endif
+
+.globl early_putch
+/* Print a character on the UART - this function is called by C
+ * x0: character to print */
+early_putch:
+        ldr   x23, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+        early_uart_ready x23, 1
+        early_uart_transmit x23, w0
+        ret
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index ef02899..79a8da9 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -29,9 +29,13 @@
 #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 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=1 P=1 */
 
+#if (defined (EARLY_PRINTK)) && (defined (EARLY_PRINTK_INC))
+#include EARLY_PRINTK_INC
+#endif
+
 /* Macro to print a string to the UART, if there is one.
- * Clobbers r0-r3. */
-#ifdef EARLY_UART_ADDRESS
+ * Clobbers x0-x3. */
+#ifdef EARLY_PRINTK
 #define PRINT(_s)       \
         adr   x0, 98f ; \
         bl    puts    ; \
@@ -39,9 +43,9 @@
 98:     .asciz _s     ; \
         .align 2      ; \
 99:
-#else
+#else /* EARLY_PRINTK */
 #define PRINT(s)
-#endif
+#endif /* !EARLY_PRINTK */
 
         /*.aarch64*/
 
@@ -109,8 +113,8 @@ real_start:
 2:
 
 boot_cpu:
-#ifdef EARLY_UART_ADDRESS
-        ldr   x23, =EARLY_UART_ADDRESS  /* x23 := UART base address */
+#ifdef EARLY_PRINTK
+        ldr   x23, =EARLY_UART_BASE_ADDRESS /* x23 := UART base address */
         cbnz  x22, 1f
         bl    init_uart                 /* CPU 0 sets up the UART too */
 1:      PRINT("- CPU ")
@@ -206,7 +210,6 @@ skip_bss:
         mov   x4, x1                 /* Next level into xen_first */
 
        /* console fixmap */
-#ifdef EARLY_UART_ADDRESS
         ldr   x1, =xen_fixmap
         add   x1, x1, x20            /* x1 := paddr (xen_fixmap) */
         lsr   x2, x23, #12
@@ -214,7 +217,6 @@ skip_bss:
         mov   x3, #PT_DEV_L3
         orr   x2, x2, x3             /* x2 := 4K dev map including UART */
         str   x2, [x1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
-#endif
 
         /* Build the baseline idle pagetable's first-level entries */
         ldr   x1, =xen_second
@@ -266,10 +268,8 @@ pt_ready:
         br    x1                     /* Get a proper vaddr into PC */
 paging:
 
-#ifdef EARLY_UART_ADDRESS
         /* Use a virtual address to access the UART. */
         ldr   x23, =FIXMAP_ADDR(FIXMAP_CONSOLE)
-#endif
 
         PRINT("- Ready -\r\n")
 
@@ -329,51 +329,44 @@ fail:   PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
 
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
 
-/* Bring up the UART. Specific to the PL011 UART.
- * Clobbers r0-r2 */
+/* Bring up the UART.
+ * x23: Early UART base address
+ * Clobbers x0-x1 */
 init_uart:
-        mov   x1, #0x0
-        strh  w1, [x23, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
-        mov   x1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
-        strh  w1, [x23, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
-        mov   x1, #0x60              /* 8n1 */
-        strh  w1, [x23, #0x24]       /* -> UARTLCR_H (Line control) */
-        ldr   x1, =0x00000301        /* RXE | TXE | UARTEN */
-        strh  w1, [x23, #0x30]       /* -> UARTCR (Control Register) */
+        early_uart_init x23, 0
         adr   x0, 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 */
+/* Print early debug messages.
+ * x0: Nul-terminated string to print.
+ * x23: Early UART base address
+ * Clobbers x0-x1 */
 puts:
-        ldrh  w2, [x23, #0x18]       /* <- UARTFR (Flag register) */
-        tst   w2, #0x8               /* Check BUSY bit */
-        b.ne  puts                   /* Wait for the UART to be ready */
-        ldrb  w2, [x0], #1           /* Load next char */
-        cbz   w2, 1f                 /* Exit on nul */
-        str   w2, [x23]              /* -> UARTDR (Data Register) */
+        early_uart_ready x23, 1
+        ldrb  w1, [x0], #1           /* Load next char */
+        cbz   w1, 1f                 /* Exit on nul */
+        early_uart_transmit x23, w1
         b     puts
 1:
         ret
 
 /* Print a 32-bit number in hex.  Specific to the PL011 UART.
- * r0: Number to print.
- * clobbers r0-r3 */
+ * x0: Number to print.
+ * x23: Early UART base address
+ * Clobbers x0-x3 */
 putn:
         adr   x1, hex
         mov   x3, #8
-1:      ldrh  w2, [x23, #0x18]       /* <- UARTFR (Flag register) */
-        tst   w2, #0x8               /* Check BUSY bit */
-        b.ne  1b                     /* Wait for the UART to be ready */
+1:
+        early_uart_ready x23, 2
         and   x2, x0, #0xf0000000    /* Mask off the top nybble */
         lsr   x2, x2, #28
         ldrb  w2, [x1, x2]           /* Convert to a char */
-        strb  w2, [x23]              /* -> UARTDR (Data Register) */
+        early_uart_transmit x23, w2
         lsl   x0, x0, #4             /* Roll it through one nybble at a time */
         subs  x3, x3, #1
         b.ne  1b
@@ -382,7 +375,7 @@ putn:
 hex:    .ascii "0123456789abcdef"
         .align 2
 
-#else  /* EARLY_UART_ADDRESS */
+#else  /* EARLY_PRINTK */
 
 init_uart:
 .global early_puts
@@ -390,4 +383,4 @@ early_puts:
 puts:
 putn:   ret
 
-#endif /* EARLY_UART_ADDRESS */
+#endif /* EARLY_PRINTK */
diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 0f99a43..5950323 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -15,19 +15,7 @@
 #include <xen/string.h>
 #include <asm/early_printk.h>
 
-#ifdef EARLY_UART_ADDRESS
-
-void __init early_putch(char c)
-{
-    volatile uint32_t *r;
-
-    r = (uint32_t *)(XEN_VIRT_START + (1 << 21));
-
-    /* XXX: assuming a PL011 UART. */
-    while(*(r + 0x6) & 0x8)
-        ;
-    *r = c;
-}
+void early_putch(char c);
 
 /* Early printk buffer */
 static char __initdata buf[512];
@@ -68,5 +56,3 @@ early_panic(const char *fmt, ...)
 
     while(1);
 }
-
-#endif /* #ifdef EARLY_UART_ADDRESS */
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 7599202..6414c89 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -141,8 +141,6 @@ extern unsigned long frametable_virt_end;
 #define watchdog_disable() ((void)0)
 #define watchdog_enable()  ((void)0)
 
-/* Board-specific: base address of PL011 UART */
-#define EARLY_UART_ADDRESS 0x1c090000
 /* Board-specific: base address of GIC + its regs */
 #define GIC_BASE_ADDRESS 0x2c000000
 #define GIC_DR_OFFSET 0x1000
diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index a0297a7..b72fce7 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -12,7 +12,7 @@
 
 #include <xen/config.h>
 
-#ifdef EARLY_UART_ADDRESS
+#ifdef EARLY_PRINTK
 
 void early_printk(const char *fmt, ...);
 void early_panic(const char *fmt, ...) __attribute__((noreturn));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00: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 1Uc6Pe-0004Tg-JK; Tue, 14 May 2013 04:00:30 +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 1Uc6Pd-0004TP-C9
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:29 +0000
Received: from [85.158.143.99:51190] by server-3.bemta-4.messagelabs.com id
	A0/23-02015-CD6B1915; Tue, 14 May 2013 04:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1368504024!22528963!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29640 invoked from network); 14 May 2013 04:00:25 -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;
	14 May 2013 04:00: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 1Uc6PY-0003Mr-CL
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6PX-0006cy-Gs
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:23 +0000
Date: Tue, 14 May 2013 04:00:23 +0000
Message-Id: <E1Uc6PX-0006cy-Gs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add Exynos 4210 UART 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 4b8ff0d86982d45d5d0c28d5481125a0fc49bc15
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Sun Apr 28 20:47:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Add Exynos 4210 UART support
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/arm32.mk                       |    1 +
 xen/drivers/char/Makefile             |    1 +
 xen/drivers/char/exynos4210-uart.c    |  365 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/exynos4210-uart.h |  111 ++++++++++
 4 files changed, 478 insertions(+), 0 deletions(-)

diff --git a/config/arm32.mk b/config/arm32.mk
index f64f0c1..d8e958b 100644
--- a/config/arm32.mk
+++ b/config/arm32.mk
@@ -8,6 +8,7 @@ CONFIG_ARM_$(XEN_OS) := y
 CFLAGS += -marm
 
 HAS_PL011 := y
+HAS_EXYNOS4210 := y
 
 # Use only if calling $(LD) directly.
 #LDFLAGS_DIRECT_OpenBSD = _obsd
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index 9c067f9..37543f0 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -1,6 +1,7 @@
 obj-y += console.o
 obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
+obj-$(HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(HAS_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_ARM) += dt-uart.o
 obj-y += serial.o
diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
new file mode 100644
index 0000000..f151390
--- /dev/null
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -0,0 +1,365 @@
+/*
+ * xen/drivers/char/exynos4210-uart.c
+ *
+ * Driver for Exynos 4210 UART.
+ *
+ * Anthony PERARD <anthony.perard@citrix.com>
+ * Copyright (c) 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 <xen/config.h>
+#include <xen/console.h>
+#include <xen/errno.h>
+#include <xen/serial.h>
+#include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/mm.h>
+#include <asm/early_printk.h>
+#include <asm/device.h>
+#include <asm/exynos4210-uart.h>
+
+static struct exynos4210_uart {
+    unsigned int baud, clock_hz, data_bits, parity, stop_bits;
+    struct dt_irq irq;
+    void *regs;
+    struct irqaction irqaction;
+} exynos4210_com = {0};
+
+/* These parity settings can be ORed directly into the ULCON. */
+#define PARITY_NONE  (0)
+#define PARITY_ODD   (0x4)
+#define PARITY_EVEN  (0x5)
+#define FORCED_CHECKED_AS_ONE (0x6)
+#define FORCED_CHECKED_AS_ZERO (0x7)
+
+#define exynos4210_read(uart, off)          ioreadl((uart)->regs + off)
+#define exynos4210_write(uart, off, val)    iowritel((uart->regs) + off, val)
+
+static void exynos4210_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs)
+{
+    struct serial_port *port = data;
+    struct exynos4210_uart *uart = port->uart;
+    unsigned int status;
+
+    status = exynos4210_read(uart, UINTP);
+
+    while ( status != 0 )
+    {
+        /* Clear all pending interrupts
+         * but should take care of ERROR and MODEM
+         */
+
+        if ( status & UINTM_ERROR )
+        {
+            uint32_t error_bit;
+
+            error_bit = exynos4210_read(uart, UERSTAT);
+
+            if ( error_bit & UERSTAT_OVERRUN )
+                dprintk(XENLOG_ERR, "uart: overrun error\n");
+            if ( error_bit & UERSTAT_PARITY )
+                dprintk(XENLOG_ERR, "uart: parity error\n");
+            if ( error_bit & UERSTAT_FRAME )
+                dprintk(XENLOG_ERR, "uart: frame error\n");
+            if ( error_bit & UERSTAT_BREAK )
+                dprintk(XENLOG_ERR, "uart: break detected\n");
+            /* Clear error pending interrupt */
+            exynos4210_write(uart, UINTP, UINTM_ERROR);
+        }
+
+
+        if ( status & (UINTM_RXD | UINTM_ERROR) )
+        {
+            /* uart->regs[UINTM] |= RXD|ERROR; */
+            serial_rx_interrupt(port, regs);
+            /* uart->regs[UINTM] &= ~(RXD|ERROR); */
+            exynos4210_write(uart, UINTP, UINTM_RXD | UINTM_ERROR);
+        }
+
+        if ( status & (UINTM_TXD | UINTM_MODEM) )
+        {
+            /* uart->regs[UINTM] |= TXD|MODEM; */
+            serial_tx_interrupt(port, regs);
+            /* uart->regs[UINTM] &= ~(TXD|MODEM); */
+            exynos4210_write(uart, UINTP, UINTM_TXD | UINTM_MODEM);
+        }
+
+        status = exynos4210_read(uart, UINTP);
+    }
+}
+
+static void __init exynos4210_uart_init_preirq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+    unsigned int divisor;
+    uint32_t ulcon;
+
+    /* reset, TX/RX disables */
+    exynos4210_write(uart, UCON, 0);
+
+    /* No Interrupt, auto flow control */
+    exynos4210_write(uart, UMCON, 0);
+
+    /* Line control and baud-rate generator. */
+    if ( uart->baud != BAUD_AUTO )
+    {
+        /* Baud rate specified: program it into the divisor latch. */
+        divisor = ((uart->clock_hz) / (uart->baud)) - 1;
+        /* FIXME: will use a hacked divisor, assuming the src clock and bauds */
+        exynos4210_write(uart, UFRACVAL, 53);
+        exynos4210_write(uart, UBRDIV, 4);
+    }
+    else
+    {
+        /*
+         * TODO: should be updated
+         * Baud rate already set: read it out from the divisor latch.
+         * divisor = (uart->regs[IBRD] << 6) | uart->regs[FBRD];
+         * uart->baud = (uart->clock_hz << 2) / divisor;
+         */
+    }
+
+    /*
+     * Number of bits per character
+     * 0 => 5 bits
+     * 1 => 6 bits
+     * 2 => 7 bits
+     * 3 => 8 bits
+     */
+    ASSERT(uart->data_bits >= 5 && uart->data_bits <= 8);
+    ulcon = (uart->data_bits - 5);
+
+    /*
+     * Stop bits
+     * 0 => 1 stop bit per frame
+     * 1 => 2 stop bit per frame
+     */
+    ASSERT(uart->stop_bits >= 1 && uart->stop_bits <= 2);
+    ulcon |= (uart->stop_bits - 1) << ULCON_STOPB_SHIFT;
+
+
+    /* Parity */
+    ulcon |= uart->parity << ULCON_PARITY_SHIFT;
+
+    exynos4210_write(uart, ULCON, ulcon);
+
+    /* Mask and clear the interrupts */
+    exynos4210_write(uart, UINTM, UINTM_ALLI);
+    exynos4210_write(uart, UINTP, UINTM_ALLI);
+
+    /* reset FIFO */
+    exynos4210_write(uart, UFCON, UFCON_FIFO_RESET);
+
+    /* TODO: Add timeout to avoid infinite loop */
+    while ( exynos4210_read(uart, UFCON) & UFCON_FIFO_RESET )
+        ;
+
+    /*
+     * Enable FIFO and set the trigger level of Tx FIFO
+     * The trigger level is always set to b101, an interrupt will be
+     * generated when data count of Tx FIFO is less than or equal to the
+     * following value:
+     * UART0 => 160 bytes
+     * UART1 => 40 bytes
+     * UART2 => 10 bytes
+     * UART3 => 10 bytes
+     */
+    exynos4210_write(uart, UFCON, UFCON_FIFO_TX_TRIGGER | UFCON_FIFO_EN);
+
+    /*
+     * Enable the UART for Rx and Tx
+     *   - Use only interrupt request
+     *   - Interrupts are level trigger
+     *   - Enable Rx timeout
+     */
+    exynos4210_write(uart, UCON,
+                     UCON_RX_IRQ_LEVEL | UCON_TX_IRQ_LEVEL | UCON_RX_IRQ |
+                     UCON_TX_IRQ | UCON_RX_TIMEOUT);
+}
+
+static void __init exynos4210_uart_init_postirq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+    int rc;
+
+    uart->irqaction.handler = exynos4210_uart_interrupt;
+    uart->irqaction.name    = "exynos4210_uart";
+    uart->irqaction.dev_id  = port;
+
+    if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
+        dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
+                uart->irq.irq);
+
+    /* Unmask interrupts */
+    exynos4210_write(uart, UINTM, ~UINTM_ALLI);
+
+    /* Clear pending interrupts */
+    exynos4210_write(uart, UINTP, UINTM_ALLI);
+
+    /* Enable interrupts */
+    exynos4210_write(uart, UMCON, exynos4210_read(uart, UMCON) | UMCON_INT_EN);
+}
+
+static void exynos4210_uart_suspend(struct serial_port *port)
+{
+    BUG(); // XXX
+}
+
+static void exynos4210_uart_resume(struct serial_port *port)
+{
+    BUG(); // XXX
+}
+
+static unsigned int exynos4210_uart_tx_ready(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    /* Tx fifo full ? */
+    if ( exynos4210_read(uart, UFSTAT) & UFSTAT_TX_FULL )
+        return 0;
+    else
+    {
+        uint32_t val = exynos4210_read(uart, UFSTAT);
+
+        val = (val & UFSTAT_TX_COUNT_MASK) >> UFSTAT_TX_COUNT_SHIFT;
+
+        /* XXX: Here we assume that we use UART 2/3, on the others
+         * UART the buffer is bigger
+         */
+        ASSERT(val >= 0 && val <= FIFO_MAX_SIZE);
+
+        return (FIFO_MAX_SIZE - val);
+    }
+}
+
+static void exynos4210_uart_putc(struct serial_port *port, char c)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    exynos4210_write(uart, UTXH, (uint32_t)(unsigned char)c);
+}
+
+static int exynos4210_uart_getc(struct serial_port *port, char *pc)
+{
+    struct exynos4210_uart *uart = port->uart;
+    uint32_t ufstat = exynos4210_read(uart, UFSTAT);
+    uint32_t count;
+
+    count = (ufstat & UFSTAT_RX_COUNT_MASK) >> UFSTAT_RX_COUNT_SHIFT;
+
+    /* Check if Rx fifo is full or if the is something in it */
+    if ( ufstat & UFSTAT_RX_FULL || count )
+    {
+        *pc = exynos4210_read(uart, URXH) & URXH_DATA_MASK;
+        return 1;
+    }
+    else
+        return 0;
+}
+
+static int __init exynos4210_uart_irq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    return uart->irq.irq;
+}
+
+static const struct dt_irq __init *exynos4210_uart_dt_irq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    return &uart->irq;
+}
+
+static struct uart_driver __read_mostly exynos4210_uart_driver = {
+    .init_preirq  = exynos4210_uart_init_preirq,
+    .init_postirq = exynos4210_uart_init_postirq,
+    .endboot      = NULL,
+    .suspend      = exynos4210_uart_suspend,
+    .resume       = exynos4210_uart_resume,
+    .tx_ready     = exynos4210_uart_tx_ready,
+    .putc         = exynos4210_uart_putc,
+    .getc         = exynos4210_uart_getc,
+    .irq          = exynos4210_uart_irq,
+    .dt_irq_get   = exynos4210_uart_dt_irq,
+};
+
+/* TODO: Parse UART config from the command line */
+static int __init exynos4210_uart_init(struct dt_device_node *dev,
+                                       const void *data)
+{
+    const char *config = data;
+    struct exynos4210_uart *uart;
+    int res;
+    u64 addr, size;
+
+    if ( strcmp(config, "") )
+    {
+        early_printk("WARNING: UART configuration is not supported\n");
+    }
+
+    uart = &exynos4210_com;
+
+    /* uart->clock_hz  = 0x16e3600; */
+    uart->baud      = BAUD_AUTO;
+    uart->data_bits = 8;
+    uart->parity    = PARITY_NONE;
+    uart->stop_bits = 1;
+
+    res = dt_device_get_address(dev, 0, &addr, &size);
+    if ( res )
+    {
+        early_printk("exynos4210: Unable to retrieve the base"
+                     " address of the UART\n");
+        return res;
+    }
+
+    uart->regs = ioremap_nocache(addr, size);
+    if ( !uart->regs )
+    {
+        early_printk("exynos4210: Unable to map the UART memory\n");
+    }
+    res = dt_device_get_irq(dev, 0, &uart->irq);
+    if ( res )
+    {
+        early_printk("exynos4210: Unable to retrieve the IRQ\n");
+        return res;
+    }
+
+    /* Register with generic serial driver. */
+    serial_register_uart(SERHND_DTUART, &exynos4210_uart_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
+}
+
+static const char const *exynos4210_dt_compat[] __initdata =
+{
+    "samsung,exynos4210-uart",
+    NULL
+};
+
+DT_DEVICE_START(exynos4210, "Exynos 4210 UART", DEVICE_SERIAL)
+        .compatible = exynos4210_dt_compat,
+        .init = exynos4210_uart_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/exynos4210-uart.h b/xen/include/asm-arm/exynos4210-uart.h
new file mode 100644
index 0000000..330e1c0
--- /dev/null
+++ b/xen/include/asm-arm/exynos4210-uart.h
@@ -0,0 +1,111 @@
+/*
+ * xen/include/asm-arm/exynos4210-uart.h
+ *
+ * Common constant definition between early printk and the UART driver
+ * for the exynos 4210 UART
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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_EXYNOS4210_H
+#define __ASM_ARM_EXYNOS4210_H
+
+
+/*
+ * this value is only valid for UART 2 and UART 3
+ * XXX: define per UART
+ */
+#define FIFO_MAX_SIZE 16
+
+/* register addresses */
+#define ULCON     (0x00)
+#define UCON      (0x04)
+#define UFCON     (0x08)
+#define UMCON     (0x0c)
+#define UTRSTAT   (0x10)
+#define UERSTAT   (0x14)
+#define UFSTAT    (0x18)
+#define UMSTAT    (0x1c)
+#define UTXH      (0x20)
+#define URXH      (0x24)
+#define UBRDIV    (0x28)
+#define UFRACVAL  (0x2c)
+#define UINTP     (0x30)
+#define UINTS     (0x34)
+#define UINTM     (0x38)
+
+/* UCON */
+#define UCON_RX_IRQ         (1 << 0)
+#define UCON_TX_IRQ         (1 << 2)
+#define UCON_RX_TIMEOUT     (1 << 7)
+
+/*
+ * FIXME: IRQ_LEVEL should be 1 << n but with this value, the IRQ
+ * handler will never end...
+ */
+#define UCON_RX_IRQ_LEVEL   (0 << 8)
+#define UCON_TX_IRQ_LEVEL   (0 << 9)
+
+/* ULCON */
+#define ULCON_STOPB_SHIFT 2
+#define ULCON_PARITY_SHIFT 3
+
+/* UFCON */
+#define UFCON_FIFO_TX_RESET     (1 << 2)
+#define UFCON_FIFO_RX_RESET     (1 << 1)
+#define UFCON_FIFO_RESET        (UFCON_FIFO_TX_RESET | UFCON_FIFO_RX_RESET)
+#define UFCON_FIFO_EN           (1 << 0)
+
+#define UFCON_FIFO_TX_TRIGGER   (0x6 << 8)
+
+/* UMCON */
+#define UMCON_INT_EN            (1 << 3)
+
+/* UERSTAT */
+#define UERSTAT_OVERRUN (1 << 0)
+#define UERSTAT_PARITY  (1 << 1)
+#define UERSTAT_FRAME   (1 << 2)
+#define UERSTAT_BREAK   (1 << 3)
+
+/* UFSTAT */
+#define UFSTAT_TX_FULL          (1 << 24)
+#define UFSTAT_TX_COUNT_SHIFT   (16)
+#define UFSTAT_TX_COUNT_MASK    (0xff << UFSTAT_TX_COUNT_SHIFT)
+#define UFSTAT_RX_FULL          (1 << 8)
+#define UFSTAT_RX_COUNT_SHIFT   (0)
+#define UFSTAT_RX_COUNT_MASK    (0xff << UFSTAT_RX_COUNT_SHIFT)
+
+/* UTRSTAT */
+#define UTRSTAT_TX_EMPTY        (1 << 1)
+
+/* URHX */
+#define URXH_DATA_MASK  (0xff)
+
+/* Interrupt bits (UINTP, UINTS, UINTM) */
+#define UINTM_MODEM     (1 << 3)
+#define UINTM_TXD       (1 << 2)
+#define UINTM_ERROR     (1 << 1)
+#define UINTM_RXD       (1 << 0)
+#define UINTM_ALLI      (UINTM_MODEM | UINTM_TXD | UINTM_ERROR | UINTM_RXD)
+
+#endif /* __ASM_ARM_EXYNOS4210_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00: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 1Uc6Pe-0004Tg-JK; Tue, 14 May 2013 04:00:30 +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 1Uc6Pd-0004TP-C9
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:29 +0000
Received: from [85.158.143.99:51190] by server-3.bemta-4.messagelabs.com id
	A0/23-02015-CD6B1915; Tue, 14 May 2013 04:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1368504024!22528963!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29640 invoked from network); 14 May 2013 04:00:25 -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;
	14 May 2013 04:00: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 1Uc6PY-0003Mr-CL
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6PX-0006cy-Gs
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:23 +0000
Date: Tue, 14 May 2013 04:00:23 +0000
Message-Id: <E1Uc6PX-0006cy-Gs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add Exynos 4210 UART 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 4b8ff0d86982d45d5d0c28d5481125a0fc49bc15
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Sun Apr 28 20:47:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Add Exynos 4210 UART support
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/arm32.mk                       |    1 +
 xen/drivers/char/Makefile             |    1 +
 xen/drivers/char/exynos4210-uart.c    |  365 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/exynos4210-uart.h |  111 ++++++++++
 4 files changed, 478 insertions(+), 0 deletions(-)

diff --git a/config/arm32.mk b/config/arm32.mk
index f64f0c1..d8e958b 100644
--- a/config/arm32.mk
+++ b/config/arm32.mk
@@ -8,6 +8,7 @@ CONFIG_ARM_$(XEN_OS) := y
 CFLAGS += -marm
 
 HAS_PL011 := y
+HAS_EXYNOS4210 := y
 
 # Use only if calling $(LD) directly.
 #LDFLAGS_DIRECT_OpenBSD = _obsd
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index 9c067f9..37543f0 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -1,6 +1,7 @@
 obj-y += console.o
 obj-$(HAS_NS16550) += ns16550.o
 obj-$(HAS_PL011) += pl011.o
+obj-$(HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(HAS_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_ARM) += dt-uart.o
 obj-y += serial.o
diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
new file mode 100644
index 0000000..f151390
--- /dev/null
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -0,0 +1,365 @@
+/*
+ * xen/drivers/char/exynos4210-uart.c
+ *
+ * Driver for Exynos 4210 UART.
+ *
+ * Anthony PERARD <anthony.perard@citrix.com>
+ * Copyright (c) 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 <xen/config.h>
+#include <xen/console.h>
+#include <xen/errno.h>
+#include <xen/serial.h>
+#include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/mm.h>
+#include <asm/early_printk.h>
+#include <asm/device.h>
+#include <asm/exynos4210-uart.h>
+
+static struct exynos4210_uart {
+    unsigned int baud, clock_hz, data_bits, parity, stop_bits;
+    struct dt_irq irq;
+    void *regs;
+    struct irqaction irqaction;
+} exynos4210_com = {0};
+
+/* These parity settings can be ORed directly into the ULCON. */
+#define PARITY_NONE  (0)
+#define PARITY_ODD   (0x4)
+#define PARITY_EVEN  (0x5)
+#define FORCED_CHECKED_AS_ONE (0x6)
+#define FORCED_CHECKED_AS_ZERO (0x7)
+
+#define exynos4210_read(uart, off)          ioreadl((uart)->regs + off)
+#define exynos4210_write(uart, off, val)    iowritel((uart->regs) + off, val)
+
+static void exynos4210_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs)
+{
+    struct serial_port *port = data;
+    struct exynos4210_uart *uart = port->uart;
+    unsigned int status;
+
+    status = exynos4210_read(uart, UINTP);
+
+    while ( status != 0 )
+    {
+        /* Clear all pending interrupts
+         * but should take care of ERROR and MODEM
+         */
+
+        if ( status & UINTM_ERROR )
+        {
+            uint32_t error_bit;
+
+            error_bit = exynos4210_read(uart, UERSTAT);
+
+            if ( error_bit & UERSTAT_OVERRUN )
+                dprintk(XENLOG_ERR, "uart: overrun error\n");
+            if ( error_bit & UERSTAT_PARITY )
+                dprintk(XENLOG_ERR, "uart: parity error\n");
+            if ( error_bit & UERSTAT_FRAME )
+                dprintk(XENLOG_ERR, "uart: frame error\n");
+            if ( error_bit & UERSTAT_BREAK )
+                dprintk(XENLOG_ERR, "uart: break detected\n");
+            /* Clear error pending interrupt */
+            exynos4210_write(uart, UINTP, UINTM_ERROR);
+        }
+
+
+        if ( status & (UINTM_RXD | UINTM_ERROR) )
+        {
+            /* uart->regs[UINTM] |= RXD|ERROR; */
+            serial_rx_interrupt(port, regs);
+            /* uart->regs[UINTM] &= ~(RXD|ERROR); */
+            exynos4210_write(uart, UINTP, UINTM_RXD | UINTM_ERROR);
+        }
+
+        if ( status & (UINTM_TXD | UINTM_MODEM) )
+        {
+            /* uart->regs[UINTM] |= TXD|MODEM; */
+            serial_tx_interrupt(port, regs);
+            /* uart->regs[UINTM] &= ~(TXD|MODEM); */
+            exynos4210_write(uart, UINTP, UINTM_TXD | UINTM_MODEM);
+        }
+
+        status = exynos4210_read(uart, UINTP);
+    }
+}
+
+static void __init exynos4210_uart_init_preirq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+    unsigned int divisor;
+    uint32_t ulcon;
+
+    /* reset, TX/RX disables */
+    exynos4210_write(uart, UCON, 0);
+
+    /* No Interrupt, auto flow control */
+    exynos4210_write(uart, UMCON, 0);
+
+    /* Line control and baud-rate generator. */
+    if ( uart->baud != BAUD_AUTO )
+    {
+        /* Baud rate specified: program it into the divisor latch. */
+        divisor = ((uart->clock_hz) / (uart->baud)) - 1;
+        /* FIXME: will use a hacked divisor, assuming the src clock and bauds */
+        exynos4210_write(uart, UFRACVAL, 53);
+        exynos4210_write(uart, UBRDIV, 4);
+    }
+    else
+    {
+        /*
+         * TODO: should be updated
+         * Baud rate already set: read it out from the divisor latch.
+         * divisor = (uart->regs[IBRD] << 6) | uart->regs[FBRD];
+         * uart->baud = (uart->clock_hz << 2) / divisor;
+         */
+    }
+
+    /*
+     * Number of bits per character
+     * 0 => 5 bits
+     * 1 => 6 bits
+     * 2 => 7 bits
+     * 3 => 8 bits
+     */
+    ASSERT(uart->data_bits >= 5 && uart->data_bits <= 8);
+    ulcon = (uart->data_bits - 5);
+
+    /*
+     * Stop bits
+     * 0 => 1 stop bit per frame
+     * 1 => 2 stop bit per frame
+     */
+    ASSERT(uart->stop_bits >= 1 && uart->stop_bits <= 2);
+    ulcon |= (uart->stop_bits - 1) << ULCON_STOPB_SHIFT;
+
+
+    /* Parity */
+    ulcon |= uart->parity << ULCON_PARITY_SHIFT;
+
+    exynos4210_write(uart, ULCON, ulcon);
+
+    /* Mask and clear the interrupts */
+    exynos4210_write(uart, UINTM, UINTM_ALLI);
+    exynos4210_write(uart, UINTP, UINTM_ALLI);
+
+    /* reset FIFO */
+    exynos4210_write(uart, UFCON, UFCON_FIFO_RESET);
+
+    /* TODO: Add timeout to avoid infinite loop */
+    while ( exynos4210_read(uart, UFCON) & UFCON_FIFO_RESET )
+        ;
+
+    /*
+     * Enable FIFO and set the trigger level of Tx FIFO
+     * The trigger level is always set to b101, an interrupt will be
+     * generated when data count of Tx FIFO is less than or equal to the
+     * following value:
+     * UART0 => 160 bytes
+     * UART1 => 40 bytes
+     * UART2 => 10 bytes
+     * UART3 => 10 bytes
+     */
+    exynos4210_write(uart, UFCON, UFCON_FIFO_TX_TRIGGER | UFCON_FIFO_EN);
+
+    /*
+     * Enable the UART for Rx and Tx
+     *   - Use only interrupt request
+     *   - Interrupts are level trigger
+     *   - Enable Rx timeout
+     */
+    exynos4210_write(uart, UCON,
+                     UCON_RX_IRQ_LEVEL | UCON_TX_IRQ_LEVEL | UCON_RX_IRQ |
+                     UCON_TX_IRQ | UCON_RX_TIMEOUT);
+}
+
+static void __init exynos4210_uart_init_postirq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+    int rc;
+
+    uart->irqaction.handler = exynos4210_uart_interrupt;
+    uart->irqaction.name    = "exynos4210_uart";
+    uart->irqaction.dev_id  = port;
+
+    if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
+        dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
+                uart->irq.irq);
+
+    /* Unmask interrupts */
+    exynos4210_write(uart, UINTM, ~UINTM_ALLI);
+
+    /* Clear pending interrupts */
+    exynos4210_write(uart, UINTP, UINTM_ALLI);
+
+    /* Enable interrupts */
+    exynos4210_write(uart, UMCON, exynos4210_read(uart, UMCON) | UMCON_INT_EN);
+}
+
+static void exynos4210_uart_suspend(struct serial_port *port)
+{
+    BUG(); // XXX
+}
+
+static void exynos4210_uart_resume(struct serial_port *port)
+{
+    BUG(); // XXX
+}
+
+static unsigned int exynos4210_uart_tx_ready(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    /* Tx fifo full ? */
+    if ( exynos4210_read(uart, UFSTAT) & UFSTAT_TX_FULL )
+        return 0;
+    else
+    {
+        uint32_t val = exynos4210_read(uart, UFSTAT);
+
+        val = (val & UFSTAT_TX_COUNT_MASK) >> UFSTAT_TX_COUNT_SHIFT;
+
+        /* XXX: Here we assume that we use UART 2/3, on the others
+         * UART the buffer is bigger
+         */
+        ASSERT(val >= 0 && val <= FIFO_MAX_SIZE);
+
+        return (FIFO_MAX_SIZE - val);
+    }
+}
+
+static void exynos4210_uart_putc(struct serial_port *port, char c)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    exynos4210_write(uart, UTXH, (uint32_t)(unsigned char)c);
+}
+
+static int exynos4210_uart_getc(struct serial_port *port, char *pc)
+{
+    struct exynos4210_uart *uart = port->uart;
+    uint32_t ufstat = exynos4210_read(uart, UFSTAT);
+    uint32_t count;
+
+    count = (ufstat & UFSTAT_RX_COUNT_MASK) >> UFSTAT_RX_COUNT_SHIFT;
+
+    /* Check if Rx fifo is full or if the is something in it */
+    if ( ufstat & UFSTAT_RX_FULL || count )
+    {
+        *pc = exynos4210_read(uart, URXH) & URXH_DATA_MASK;
+        return 1;
+    }
+    else
+        return 0;
+}
+
+static int __init exynos4210_uart_irq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    return uart->irq.irq;
+}
+
+static const struct dt_irq __init *exynos4210_uart_dt_irq(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    return &uart->irq;
+}
+
+static struct uart_driver __read_mostly exynos4210_uart_driver = {
+    .init_preirq  = exynos4210_uart_init_preirq,
+    .init_postirq = exynos4210_uart_init_postirq,
+    .endboot      = NULL,
+    .suspend      = exynos4210_uart_suspend,
+    .resume       = exynos4210_uart_resume,
+    .tx_ready     = exynos4210_uart_tx_ready,
+    .putc         = exynos4210_uart_putc,
+    .getc         = exynos4210_uart_getc,
+    .irq          = exynos4210_uart_irq,
+    .dt_irq_get   = exynos4210_uart_dt_irq,
+};
+
+/* TODO: Parse UART config from the command line */
+static int __init exynos4210_uart_init(struct dt_device_node *dev,
+                                       const void *data)
+{
+    const char *config = data;
+    struct exynos4210_uart *uart;
+    int res;
+    u64 addr, size;
+
+    if ( strcmp(config, "") )
+    {
+        early_printk("WARNING: UART configuration is not supported\n");
+    }
+
+    uart = &exynos4210_com;
+
+    /* uart->clock_hz  = 0x16e3600; */
+    uart->baud      = BAUD_AUTO;
+    uart->data_bits = 8;
+    uart->parity    = PARITY_NONE;
+    uart->stop_bits = 1;
+
+    res = dt_device_get_address(dev, 0, &addr, &size);
+    if ( res )
+    {
+        early_printk("exynos4210: Unable to retrieve the base"
+                     " address of the UART\n");
+        return res;
+    }
+
+    uart->regs = ioremap_nocache(addr, size);
+    if ( !uart->regs )
+    {
+        early_printk("exynos4210: Unable to map the UART memory\n");
+    }
+    res = dt_device_get_irq(dev, 0, &uart->irq);
+    if ( res )
+    {
+        early_printk("exynos4210: Unable to retrieve the IRQ\n");
+        return res;
+    }
+
+    /* Register with generic serial driver. */
+    serial_register_uart(SERHND_DTUART, &exynos4210_uart_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
+}
+
+static const char const *exynos4210_dt_compat[] __initdata =
+{
+    "samsung,exynos4210-uart",
+    NULL
+};
+
+DT_DEVICE_START(exynos4210, "Exynos 4210 UART", DEVICE_SERIAL)
+        .compatible = exynos4210_dt_compat,
+        .init = exynos4210_uart_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/exynos4210-uart.h b/xen/include/asm-arm/exynos4210-uart.h
new file mode 100644
index 0000000..330e1c0
--- /dev/null
+++ b/xen/include/asm-arm/exynos4210-uart.h
@@ -0,0 +1,111 @@
+/*
+ * xen/include/asm-arm/exynos4210-uart.h
+ *
+ * Common constant definition between early printk and the UART driver
+ * for the exynos 4210 UART
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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_EXYNOS4210_H
+#define __ASM_ARM_EXYNOS4210_H
+
+
+/*
+ * this value is only valid for UART 2 and UART 3
+ * XXX: define per UART
+ */
+#define FIFO_MAX_SIZE 16
+
+/* register addresses */
+#define ULCON     (0x00)
+#define UCON      (0x04)
+#define UFCON     (0x08)
+#define UMCON     (0x0c)
+#define UTRSTAT   (0x10)
+#define UERSTAT   (0x14)
+#define UFSTAT    (0x18)
+#define UMSTAT    (0x1c)
+#define UTXH      (0x20)
+#define URXH      (0x24)
+#define UBRDIV    (0x28)
+#define UFRACVAL  (0x2c)
+#define UINTP     (0x30)
+#define UINTS     (0x34)
+#define UINTM     (0x38)
+
+/* UCON */
+#define UCON_RX_IRQ         (1 << 0)
+#define UCON_TX_IRQ         (1 << 2)
+#define UCON_RX_TIMEOUT     (1 << 7)
+
+/*
+ * FIXME: IRQ_LEVEL should be 1 << n but with this value, the IRQ
+ * handler will never end...
+ */
+#define UCON_RX_IRQ_LEVEL   (0 << 8)
+#define UCON_TX_IRQ_LEVEL   (0 << 9)
+
+/* ULCON */
+#define ULCON_STOPB_SHIFT 2
+#define ULCON_PARITY_SHIFT 3
+
+/* UFCON */
+#define UFCON_FIFO_TX_RESET     (1 << 2)
+#define UFCON_FIFO_RX_RESET     (1 << 1)
+#define UFCON_FIFO_RESET        (UFCON_FIFO_TX_RESET | UFCON_FIFO_RX_RESET)
+#define UFCON_FIFO_EN           (1 << 0)
+
+#define UFCON_FIFO_TX_TRIGGER   (0x6 << 8)
+
+/* UMCON */
+#define UMCON_INT_EN            (1 << 3)
+
+/* UERSTAT */
+#define UERSTAT_OVERRUN (1 << 0)
+#define UERSTAT_PARITY  (1 << 1)
+#define UERSTAT_FRAME   (1 << 2)
+#define UERSTAT_BREAK   (1 << 3)
+
+/* UFSTAT */
+#define UFSTAT_TX_FULL          (1 << 24)
+#define UFSTAT_TX_COUNT_SHIFT   (16)
+#define UFSTAT_TX_COUNT_MASK    (0xff << UFSTAT_TX_COUNT_SHIFT)
+#define UFSTAT_RX_FULL          (1 << 8)
+#define UFSTAT_RX_COUNT_SHIFT   (0)
+#define UFSTAT_RX_COUNT_MASK    (0xff << UFSTAT_RX_COUNT_SHIFT)
+
+/* UTRSTAT */
+#define UTRSTAT_TX_EMPTY        (1 << 1)
+
+/* URHX */
+#define URXH_DATA_MASK  (0xff)
+
+/* Interrupt bits (UINTP, UINTS, UINTM) */
+#define UINTM_MODEM     (1 << 3)
+#define UINTM_TXD       (1 << 2)
+#define UINTM_ERROR     (1 << 1)
+#define UINTM_RXD       (1 << 0)
+#define UINTM_ALLI      (UINTM_MODEM | UINTM_TXD | UINTM_ERROR | UINTM_RXD)
+
+#endif /* __ASM_ARM_EXYNOS4210_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04: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 1Uc6Pn-0004V0-MS; Tue, 14 May 2013 04:00:39 +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 1Uc6Pm-0004Uf-1H
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:38 +0000
Received: from [85.158.139.211:39750] by server-2.bemta-5.messagelabs.com id
	75/D0-26552-5E6B1915; Tue, 14 May 2013 04:00:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1368504034!21389887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9776 invoked from network); 14 May 2013 04:00:36 -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;
	14 May 2013 04:00: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 1Uc6Pi-0003N1-Ii
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Pi-0006dO-GZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:34 +0000
Date: Tue, 14 May 2013 04:00:34 +0000
Message-Id: <E1Uc6Pi-0006dO-GZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add Exynos 4210 UART support
	for early printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2a18ebbf8b0c4beda1ab94d073359e8e660b8561
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Sun Apr 28 20:56:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Add Exynos 4210 UART support for early printk
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt          |    1 +
 xen/arch/arm/Rules.mk                   |    3 +
 xen/arch/arm/arm32/debug-exynos4210.inc |   77 +++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 4065811..d5cae85 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -10,5 +10,6 @@ option should not be enable for Xens that are intended to be portable.
 CONFIG_EARLY_PRINTK=mach
 where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
+  - exynos5250: printk with the second UART
 
 By default early printk is disabled.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 297385b..b6a6890 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -46,6 +46,9 @@ ifeq ($(debug),y)
 ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
 EARLY_PRINTK_INC := pl011
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
+EARLY_PRINTK_INC := exynos4210
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm32/debug-exynos4210.inc b/xen/arch/arm/arm32/debug-exynos4210.inc
new file mode 100644
index 0000000..4241640
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-exynos4210.inc
@@ -0,0 +1,77 @@
+/*
+ * xen/arch/arm/arm32/debug-exynos4210.inc
+ *
+ * Exynos 5 specific debug code
+ *
+ * Copyright (c) 2013 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/exynos4210-uart.h>
+
+#define EARLY_UART_BASE_ADDRESS 0x12c20000
+
+/* Exynos 5 UART initialization
+ * rb: register which contains the UART base address
+ * rc: scratch register 1
+ * rd: scratch register 2 */
+.macro early_uart_init rb rc rd
+        /* init clock */
+        ldr   \rc, =0x10020000
+        /* select MPLL (800MHz) source clock */
+        ldr   \rd, [\rc, #0x250]
+        and   \rd, \rd, #(~(0xf<<8))
+        orr   \rd, \rd, #(0x6<<8)
+        str   \rd, [\rc, #0x250]
+        /* ratio 800/(7+1) */
+        ldr   \rd, [\rc, #0x558]
+        and   \rd, \rd, #(~(0xf<<8))
+        orr   \rd, \rd, #(0x7<<8)
+        str   \rd, [\rc, #0x558]
+
+        mov   \rc, #4
+        str   \rc, [\rb, #UFRACVAL]     /* -> UFRACVAL (Baud divisor fraction) */
+        mov   \rc, #53
+        str   \rc, [\rb, #UBRDIV]       /* -> UBRDIV (Baud divisor integer) */
+        mov   \rc, #3                   /* 8n1 */
+        str   \rc, [\rb, #ULCON]        /* -> (Line control) */
+        ldr   \rc, =UCON_TX_IRQ         /* TX IRQMODE */
+        str   \rc, [\rb, #UCON]         /* -> (Control Register) */
+        mov   \rc, #0x0
+        str   \rc, [\rb, #UFCON]        /* disable FIFO */
+        mov   \rc, #0x0
+        str   \rc, [\rb, #UMCON]        /* no auto flow control */
+.endm
+
+/* Exynos 5 UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register */
+.macro early_uart_ready rb rc
+1:
+        ldr   \rc, [\rb, #UTRSTAT]   /* <- UTRSTAT (Flag register) */
+        tst   \rc, #UTRSTAT_TX_EMPTY /* Check BUSY bit */
+        beq   1b                     /* Wait for the UART to be ready */
+.endm
+
+/* Exynos 5 UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit */
+.macro early_uart_transmit rb rt
+        str   \rt, [\rb, #UTXH]      /* -> UTXH (Data Register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04: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 1Uc6Pn-0004V0-MS; Tue, 14 May 2013 04:00:39 +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 1Uc6Pm-0004Uf-1H
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:38 +0000
Received: from [85.158.139.211:39750] by server-2.bemta-5.messagelabs.com id
	75/D0-26552-5E6B1915; Tue, 14 May 2013 04:00:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1368504034!21389887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9776 invoked from network); 14 May 2013 04:00:36 -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;
	14 May 2013 04:00: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 1Uc6Pi-0003N1-Ii
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Pi-0006dO-GZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:34 +0000
Date: Tue, 14 May 2013 04:00:34 +0000
Message-Id: <E1Uc6Pi-0006dO-GZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add Exynos 4210 UART support
	for early printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2a18ebbf8b0c4beda1ab94d073359e8e660b8561
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Sun Apr 28 20:56:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Add Exynos 4210 UART support for early printk
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt          |    1 +
 xen/arch/arm/Rules.mk                   |    3 +
 xen/arch/arm/arm32/debug-exynos4210.inc |   77 +++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 4065811..d5cae85 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -10,5 +10,6 @@ option should not be enable for Xens that are intended to be portable.
 CONFIG_EARLY_PRINTK=mach
 where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
+  - exynos5250: printk with the second UART
 
 By default early printk is disabled.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 297385b..b6a6890 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -46,6 +46,9 @@ ifeq ($(debug),y)
 ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
 EARLY_PRINTK_INC := pl011
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
+EARLY_PRINTK_INC := exynos4210
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm32/debug-exynos4210.inc b/xen/arch/arm/arm32/debug-exynos4210.inc
new file mode 100644
index 0000000..4241640
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-exynos4210.inc
@@ -0,0 +1,77 @@
+/*
+ * xen/arch/arm/arm32/debug-exynos4210.inc
+ *
+ * Exynos 5 specific debug code
+ *
+ * Copyright (c) 2013 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/exynos4210-uart.h>
+
+#define EARLY_UART_BASE_ADDRESS 0x12c20000
+
+/* Exynos 5 UART initialization
+ * rb: register which contains the UART base address
+ * rc: scratch register 1
+ * rd: scratch register 2 */
+.macro early_uart_init rb rc rd
+        /* init clock */
+        ldr   \rc, =0x10020000
+        /* select MPLL (800MHz) source clock */
+        ldr   \rd, [\rc, #0x250]
+        and   \rd, \rd, #(~(0xf<<8))
+        orr   \rd, \rd, #(0x6<<8)
+        str   \rd, [\rc, #0x250]
+        /* ratio 800/(7+1) */
+        ldr   \rd, [\rc, #0x558]
+        and   \rd, \rd, #(~(0xf<<8))
+        orr   \rd, \rd, #(0x7<<8)
+        str   \rd, [\rc, #0x558]
+
+        mov   \rc, #4
+        str   \rc, [\rb, #UFRACVAL]     /* -> UFRACVAL (Baud divisor fraction) */
+        mov   \rc, #53
+        str   \rc, [\rb, #UBRDIV]       /* -> UBRDIV (Baud divisor integer) */
+        mov   \rc, #3                   /* 8n1 */
+        str   \rc, [\rb, #ULCON]        /* -> (Line control) */
+        ldr   \rc, =UCON_TX_IRQ         /* TX IRQMODE */
+        str   \rc, [\rb, #UCON]         /* -> (Control Register) */
+        mov   \rc, #0x0
+        str   \rc, [\rb, #UFCON]        /* disable FIFO */
+        mov   \rc, #0x0
+        str   \rc, [\rb, #UMCON]        /* no auto flow control */
+.endm
+
+/* Exynos 5 UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register */
+.macro early_uart_ready rb rc
+1:
+        ldr   \rc, [\rb, #UTRSTAT]   /* <- UTRSTAT (Flag register) */
+        tst   \rc, #UTRSTAT_TX_EMPTY /* Check BUSY bit */
+        beq   1b                     /* Wait for the UART to be ready */
+.endm
+
+/* Exynos 5 UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit */
+.macro early_uart_transmit rb rt
+        str   \rt, [\rb, #UTXH]      /* -> UTXH (Data Register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6Pz-0004X2-QO; Tue, 14 May 2013 04:00: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 1Uc6Px-0004Wm-Sw
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:50 +0000
Received: from [85.158.143.99:35117] by server-3.bemta-4.messagelabs.com id
	A3/43-02015-1F6B1915; Tue, 14 May 2013 04:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1368504045!27435978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 343 invoked from network); 14 May 2013 04:00:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 May 2013 04:00: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 1Uc6Ps-0003N4-Qm
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Ps-0006dn-Nq
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:44 +0000
Date: Tue, 14 May 2013 04:00:44 +0000
Message-Id: <E1Uc6Ps-0006dn-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add platform specific code
	for the exynos5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8e892d358c714b00229c654c4189a5914603ac07
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 20:57:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Add platform specific code for the exynos5
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/platforms/Makefile         |    1 +
 xen/arch/arm/platforms/exynos5.c        |  110 +++++++++++++++++++++++++++++++
 xen/include/asm-arm/platforms/exynos5.h |   39 +++++++++++
 3 files changed, 150 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 4313e95..ff2b65b 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -1 +1,2 @@
 obj-y += vexpress.o
+obj-y += exynos5.o
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
new file mode 100644
index 0000000..1368a04
--- /dev/null
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -0,0 +1,110 @@
+/*
+ * xen/arch/arm/platforms/exynos5.c
+ *
+ * Exynos5 specific settings
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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/p2m.h>
+#include <xen/config.h>
+#include <xen/device_tree.h>
+#include <xen/domain_page.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/platforms/exynos5.h>
+#include <asm/platform.h>
+
+static int exynos5_init_time(void)
+{
+    uint32_t reg;
+    void __iomem *mct;
+
+    BUILD_BUG_ON(EXYNOS5_MCT_G_TCON >= PAGE_SIZE);
+
+    mct = ioremap_attr(EXYNOS5_MCT_BASE, PAGE_SIZE, PAGE_HYPERVISOR_NOCACHE);
+    if ( !mct )
+    {
+        dprintk(XENLOG_ERR, "Unable to map MCT\n");
+        return -ENOMEM;
+    }
+
+    /* Enable timer on Exynos 5250 should probably be done by u-boot */
+    reg = ioreadl(mct + EXYNOS5_MCT_G_TCON);
+    iowritel(mct + EXYNOS5_MCT_G_TCON, reg | EXYNOS5_MCT_G_TCON_START);
+
+    iounmap(mct);
+
+    return 0;
+}
+
+/* Additional mappings for dom0 (Not in the DTS) */
+static int exynos5_specific_mapping(struct domain *d)
+{
+    /* Map the chip ID */
+    map_mmio_regions(d, EXYNOS5_PA_CHIPID, EXYNOS5_PA_CHIPID + PAGE_SIZE - 1,
+                     EXYNOS5_PA_CHIPID);
+
+    /* Map the PWM region */
+    map_mmio_regions(d, EXYNOS5_PA_TIMER,
+                     EXYNOS5_PA_TIMER + (PAGE_SIZE * 2) - 1,
+                     EXYNOS5_PA_TIMER);
+
+    return 0;
+}
+
+static void exynos5_reset(void)
+{
+    void __iomem *pmu;
+
+    BUILD_BUG_ON(EXYNOS5_SWRESET >= PAGE_SIZE);
+
+    pmu = ioremap_nocache(EXYNOS5_PA_PMU, PAGE_SIZE);
+    if ( !pmu )
+    {
+        dprintk(XENLOG_ERR, "Unable to map PMU\n");
+        return;
+    }
+
+    iowritel(pmu + EXYNOS5_SWRESET, 1);
+    iounmap(pmu);
+}
+
+static uint32_t exynos5_quirks(void)
+{
+    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+}
+
+static const char const *exynos5_dt_compat[] __initdata =
+{
+    "samsung,exynos5250",
+    NULL
+};
+
+PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
+    .compatible = exynos5_dt_compat,
+    .init_time = exynos5_init_time,
+    .specific_mapping = exynos5_specific_mapping,
+    .reset = exynos5_reset,
+    .quirks = exynos5_quirks,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/platforms/exynos5.h b/xen/include/asm-arm/platforms/exynos5.h
new file mode 100644
index 0000000..ee5bdfa
--- /dev/null
+++ b/xen/include/asm-arm/platforms/exynos5.h
@@ -0,0 +1,39 @@
+#ifndef __ASM_ARM_PLATFORMS_EXYNOS5_H
+#define __ASM_ASM_PLATFORMS_EXYSNO5_H
+
+#define EXYNOS5_MCT_BASE            0x101c0000
+#define EXYNOS5_MCT_G_TCON          0x240       /* Relative to MCT_BASE */
+#define EXYNOS5_MCT_G_TCON_START    (1 << 8)
+
+#define EXYNOS5_PA_CHIPID           0x10000000
+#define EXYNOS5_PA_TIMER            0x12dd0000
+/* Base address of system controller */
+#define EXYNOS5_PA_PMU              0x10040000
+
+#define EXYNOS5_SWRESET             0x0400      /* Relative to PA_PMU */
+
+#define S5P_PA_SYSRAM   0x02020000
+
+/* Constants below is only used in assembly because the DTS is not yet parsed */
+#ifdef __ASSEMBLY__
+
+/* GIC Base Address */
+#define EXYNOS5_GIC_BASE_ADDRESS    0x10480000
+
+/* Timer's frequency */
+#define EXYNOS5_TIMER_FREQUENCY     (24 * 1000 * 1000) /* 24 MHz */
+
+/* Arndale machine ID */
+#define MACH_TYPE_SMDK5250          3774
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ARM_PLATFORMS_EXYNOS5_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:00:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:00:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Uc6Pz-0004X2-QO; Tue, 14 May 2013 04:00: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 1Uc6Px-0004Wm-Sw
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:50 +0000
Received: from [85.158.143.99:35117] by server-3.bemta-4.messagelabs.com id
	A3/43-02015-1F6B1915; Tue, 14 May 2013 04:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1368504045!27435978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 343 invoked from network); 14 May 2013 04:00:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 May 2013 04:00: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 1Uc6Ps-0003N4-Qm
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Ps-0006dn-Nq
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:44 +0000
Date: Tue, 14 May 2013 04:00:44 +0000
Message-Id: <E1Uc6Ps-0006dn-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add platform specific code
	for the exynos5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8e892d358c714b00229c654c4189a5914603ac07
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 20:57:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:01 2013 +0100

    xen/arm: Add platform specific code for the exynos5
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/platforms/Makefile         |    1 +
 xen/arch/arm/platforms/exynos5.c        |  110 +++++++++++++++++++++++++++++++
 xen/include/asm-arm/platforms/exynos5.h |   39 +++++++++++
 3 files changed, 150 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 4313e95..ff2b65b 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -1 +1,2 @@
 obj-y += vexpress.o
+obj-y += exynos5.o
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
new file mode 100644
index 0000000..1368a04
--- /dev/null
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -0,0 +1,110 @@
+/*
+ * xen/arch/arm/platforms/exynos5.c
+ *
+ * Exynos5 specific settings
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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/p2m.h>
+#include <xen/config.h>
+#include <xen/device_tree.h>
+#include <xen/domain_page.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/platforms/exynos5.h>
+#include <asm/platform.h>
+
+static int exynos5_init_time(void)
+{
+    uint32_t reg;
+    void __iomem *mct;
+
+    BUILD_BUG_ON(EXYNOS5_MCT_G_TCON >= PAGE_SIZE);
+
+    mct = ioremap_attr(EXYNOS5_MCT_BASE, PAGE_SIZE, PAGE_HYPERVISOR_NOCACHE);
+    if ( !mct )
+    {
+        dprintk(XENLOG_ERR, "Unable to map MCT\n");
+        return -ENOMEM;
+    }
+
+    /* Enable timer on Exynos 5250 should probably be done by u-boot */
+    reg = ioreadl(mct + EXYNOS5_MCT_G_TCON);
+    iowritel(mct + EXYNOS5_MCT_G_TCON, reg | EXYNOS5_MCT_G_TCON_START);
+
+    iounmap(mct);
+
+    return 0;
+}
+
+/* Additional mappings for dom0 (Not in the DTS) */
+static int exynos5_specific_mapping(struct domain *d)
+{
+    /* Map the chip ID */
+    map_mmio_regions(d, EXYNOS5_PA_CHIPID, EXYNOS5_PA_CHIPID + PAGE_SIZE - 1,
+                     EXYNOS5_PA_CHIPID);
+
+    /* Map the PWM region */
+    map_mmio_regions(d, EXYNOS5_PA_TIMER,
+                     EXYNOS5_PA_TIMER + (PAGE_SIZE * 2) - 1,
+                     EXYNOS5_PA_TIMER);
+
+    return 0;
+}
+
+static void exynos5_reset(void)
+{
+    void __iomem *pmu;
+
+    BUILD_BUG_ON(EXYNOS5_SWRESET >= PAGE_SIZE);
+
+    pmu = ioremap_nocache(EXYNOS5_PA_PMU, PAGE_SIZE);
+    if ( !pmu )
+    {
+        dprintk(XENLOG_ERR, "Unable to map PMU\n");
+        return;
+    }
+
+    iowritel(pmu + EXYNOS5_SWRESET, 1);
+    iounmap(pmu);
+}
+
+static uint32_t exynos5_quirks(void)
+{
+    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+}
+
+static const char const *exynos5_dt_compat[] __initdata =
+{
+    "samsung,exynos5250",
+    NULL
+};
+
+PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
+    .compatible = exynos5_dt_compat,
+    .init_time = exynos5_init_time,
+    .specific_mapping = exynos5_specific_mapping,
+    .reset = exynos5_reset,
+    .quirks = exynos5_quirks,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/platforms/exynos5.h b/xen/include/asm-arm/platforms/exynos5.h
new file mode 100644
index 0000000..ee5bdfa
--- /dev/null
+++ b/xen/include/asm-arm/platforms/exynos5.h
@@ -0,0 +1,39 @@
+#ifndef __ASM_ARM_PLATFORMS_EXYNOS5_H
+#define __ASM_ASM_PLATFORMS_EXYSNO5_H
+
+#define EXYNOS5_MCT_BASE            0x101c0000
+#define EXYNOS5_MCT_G_TCON          0x240       /* Relative to MCT_BASE */
+#define EXYNOS5_MCT_G_TCON_START    (1 << 8)
+
+#define EXYNOS5_PA_CHIPID           0x10000000
+#define EXYNOS5_PA_TIMER            0x12dd0000
+/* Base address of system controller */
+#define EXYNOS5_PA_PMU              0x10040000
+
+#define EXYNOS5_SWRESET             0x0400      /* Relative to PA_PMU */
+
+#define S5P_PA_SYSRAM   0x02020000
+
+/* Constants below is only used in assembly because the DTS is not yet parsed */
+#ifdef __ASSEMBLY__
+
+/* GIC Base Address */
+#define EXYNOS5_GIC_BASE_ADDRESS    0x10480000
+
+/* Timer's frequency */
+#define EXYNOS5_TIMER_FREQUENCY     (24 * 1000 * 1000) /* 24 MHz */
+
+/* Arndale machine ID */
+#define MACH_TYPE_SMDK5250          3774
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ARM_PLATFORMS_EXYNOS5_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04: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 1Uc6Q7-0004Yh-VV; Tue, 14 May 2013 04:00: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 1Uc6Q6-0004YE-Ee
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:58 +0000
Received: from [85.158.139.211:23716] by server-5.bemta-5.messagelabs.com id
	91/AB-27009-9F6B1915; Tue, 14 May 2013 04:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1368504055!22512022!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18592 invoked from network); 14 May 2013 04:00:56 -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;
	14 May 2013 04:00: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 1Uc6Q3-0003ND-0C
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Q2-0006eF-UW
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:54 +0000
Date: Tue, 14 May 2013 04:00:54 +0000
Message-Id: <E1Uc6Q2-0006eF-UW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: WORKAROUND Support kick cpus
	and switch to hypervisor for the exynos5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 bd74772eb65f6624437f789c1e6884e073a03fcc
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 21:07:20 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:02 2013 +0100

    xen/arm: WORKAROUND Support kick cpus and switch to hypervisor for the exynos5
    
    Use machine ID to know what is the current board. This value is only given
    to the first CPU by the bootloader.
    
    When the exynos 5 starts, there is only one CPU up. Xen needs to start the
    secondary cpu. The latter boots in secure mode.
    
    Theses modifications aim to be removed as soon as possible. It should
    be moved either in a platform specific boot-wrapper (which will be start
    before Xen), or in the bootloader (assuming U-Boot/Grub will support SMP).
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S                |   19 +++++++-
 xen/arch/arm/arm32/mode_switch.S         |   75 ++++++++++++++++++++++-------
 xen/include/asm-arm/platforms/vexpress.h |   11 ++++
 3 files changed, 86 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index d452b59..ec7f640 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -76,7 +76,7 @@ past_zImage:
         cpsid aif                    /* Disable all interrupts */
 
         /* Save the bootloader arguments in less-clobberable registers */
-        /* No need to save r1 == Unused ARM-linux machine type */
+        mov   r5, r1                 /* r5: ARM-linux machine type */
         mov   r8, r2                 /* r8 := DTB base address */
 
         /* Find out where we are */
@@ -119,11 +119,25 @@ boot_cpu:
         bl    putn
         PRINT(" booting -\r\n")
 #endif
+        /* Secondary CPUs doesn't have machine ID
+         *  - Store machine ID on boot CPU
+         *  - Load machine ID on secondary CPUs
+         * Machine ID is needed in kick_cpus and enter_hyp_mode */
+        ldr   r0, =machine_id           /* VA of machine_id */
+        add   r0, r0, r10               /* PA of machine_id */
+        teq   r12, #0
+        streq r5, [r0]                  /* On boot CPU save machine ID */
+        ldrne r5, [r0]                  /* If non boot cpu r5 := machine ID */
 
         /* Wake up secondary cpus */
         teq   r12, #0
         bleq  kick_cpus
 
+        PRINT("- Machine ID ")
+        mov   r0, r5
+        bl    putn
+        PRINT(" -\r\n")
+
         /* Check that this CPU has Hyp mode */
         mrc   CP32(r0, ID_PFR1)
         and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
@@ -403,6 +417,9 @@ putn:   mov   pc, lr
 
 #endif /* !EARLY_PRINTK */
 
+/* Place holder for machine ID */
+machine_id: .word 0x0
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/arm32/mode_switch.S b/xen/arch/arm/arm32/mode_switch.S
index d6741d0..c92a1cf 100644
--- a/xen/arch/arm/arm32/mode_switch.S
+++ b/xen/arch/arm/arm32/mode_switch.S
@@ -20,14 +20,21 @@
 #include <asm/config.h>
 #include <asm/page.h>
 #include <asm/platforms/vexpress.h>
+#include <asm/platforms/exynos5.h>
 #include <asm/asm_defns.h>
 #include <asm/gic.h>
 
-
-/* XXX: Versatile Express specific code */
-/* wake up secondary cpus */
+/* Wake up secondary cpus
+ * This code relies on Machine ID and only works for Vexpress and the Arndale
+ * TODO: Move this code either later (via platform specific desc) or in a bootwrapper
+ * r5: Machine ID
+ * Clobber r0 r2 */
 .globl kick_cpus
 kick_cpus:
+        ldr   r0, =MACH_TYPE_SMDK5250
+        teq   r5, r0                          /* Are we running on the arndale? */
+        beq   kick_cpus_arndale
+        /* otherwise versatile express */
         /* write start paddr to v2m sysreg FLAGSSET register */
         ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
         dsb
@@ -38,8 +45,20 @@ kick_cpus:
         add   r2, r2, r10
         str   r2, [r0, #(V2M_SYS_FLAGSSET)]
         dsb
+        ldr   r2, =V2M_GIC_BASE_ADDRESS       /* r2 := VE gic base address */
+        b     kick_cpus_sgi
+kick_cpus_arndale:
+        /* write start paddr to CPU 1 sysreg register */
+        ldr   r0, =(S5P_PA_SYSRAM)
+        ldr   r2, =start
+        add   r2, r2, r10
+        str   r2, [r0]
+        dsb
+        ldr   r2, =EXYNOS5_GIC_BASE_ADDRESS   /* r2 := Exynos5 gic base address */
+kick_cpus_sgi:
         /* send an interrupt */
-        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+        ldr   r0, =GIC_DR_OFFSET              /* GIC distributor offset */
+        add   r0, r2                          /* r0 := r0 + gic base address */
         mov   r2, #0x1
         str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
         mov   r2, #0xfe0000
@@ -51,13 +70,15 @@ kick_cpus:
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
  *
- * Expects r12 == CPU number
+ * r5: Machine ID
+ * r12: CPU number
  *
- * This code is specific to the VE model, and not intended to be used
+ * This code is specific to the VE model/Arndale, 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. */
+ * in Hyp mode.
+ * Clobber r0 - r4 */
 
 .globl enter_hyp_mode
 enter_hyp_mode:
@@ -68,33 +89,51 @@ enter_hyp_mode:
         orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
         bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
         mcr   CP32(r0, SCR)
+
+        ldr   r2, =MACH_TYPE_SMDK5250   /* r4 := Arndale machine ID */
+        /* By default load Arndale defaults values */
+        ldr   r0, =EXYNOS5_TIMER_FREQUENCY  /* r0 := timer's frequency */
+        ldr   r1, =EXYNOS5_GIC_BASE_ADDRESS /* r1 := GIC base address */
+        /* If it's not the Arndale machine ID, load VE values */
+        teq   r5, r2
+        ldrne r0, =V2M_TIMER_FREQUENCY
+        ldrne r1, =V2M_GIC_BASE_ADDRESS
+
         /* 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 */
+         * right frequency. */
         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
+
+        add   r0, r1, #GIC_DR_OFFSET
         /* Disable the GIC distributor, on the boot CPU only */
-        mov   r1, #0
+        mov   r4, #0
         teq   r12, #0                /* Is this the boot CPU? */
-        streq r1, [r0]
+        streq r4, [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) */
+        teq   r12, #0                /* Boot CPU? */
+        bne   skip_spis              /* Don't route SPIs on secondary CPUs */
+
+        add   r4, r1, #GIC_DR_OFFSET
+        ldr   r4, [r4, #4]            /* r4 := Interrupt Controller Type Reg */
+        and   r4, r4, #GICD_TYPE_LINES /* r4 := number of SPIs */
+1:      teq   r4, #0
+        beq   skip_spis
+        add   r0, r0, #4             /* Go to the new group */
+        str   r2, [r0]               /* Update the group */
+        sub  r4, r4, #1
+        b     1b
+skip_spis:
         /* Disable the GIC CPU interface on all processors */
-        mov   r0, #GIC_BASE_ADDRESS
-        add   r0, r0, #GIC_CR_OFFSET
+        add   r0, r1, #GIC_CR_OFFSET
         mov   r1, #0
         str   r1, [r0]
         /* Must drop priority mask below 0x80 before entering NS state */
diff --git a/xen/include/asm-arm/platforms/vexpress.h b/xen/include/asm-arm/platforms/vexpress.h
index 5cf3aba..982a293 100644
--- a/xen/include/asm-arm/platforms/vexpress.h
+++ b/xen/include/asm-arm/platforms/vexpress.h
@@ -32,6 +32,17 @@
 int vexpress_syscfg(int write, int function, int device, uint32_t *data);
 #endif
 
+/* Constants below is only used in assembly because the DTS is not yet parsed */
+#ifdef __ASSEMBLY__
+
+/* GIC base address */
+#define V2M_GIC_BASE_ADDRESS        0x2c000000
+
+/* Timer's frequency */
+#define V2M_TIMER_FREQUENCY         0x5f5e100 /* 100 Mhz */
+
+#endif /* __ASSEMBLY__ */
+
 #endif /* __ASM_ARM_PLATFORMS_VEXPRESS_H */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04: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 1Uc6Q7-0004Yh-VV; Tue, 14 May 2013 04:00: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 1Uc6Q6-0004YE-Ee
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:58 +0000
Received: from [85.158.139.211:23716] by server-5.bemta-5.messagelabs.com id
	91/AB-27009-9F6B1915; Tue, 14 May 2013 04:00:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1368504055!22512022!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18592 invoked from network); 14 May 2013 04:00:56 -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;
	14 May 2013 04:00: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 1Uc6Q3-0003ND-0C
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Q2-0006eF-UW
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:00:54 +0000
Date: Tue, 14 May 2013 04:00:54 +0000
Message-Id: <E1Uc6Q2-0006eF-UW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: WORKAROUND Support kick cpus
	and switch to hypervisor for the exynos5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 bd74772eb65f6624437f789c1e6884e073a03fcc
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 21:07:20 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:02 2013 +0100

    xen/arm: WORKAROUND Support kick cpus and switch to hypervisor for the exynos5
    
    Use machine ID to know what is the current board. This value is only given
    to the first CPU by the bootloader.
    
    When the exynos 5 starts, there is only one CPU up. Xen needs to start the
    secondary cpu. The latter boots in secure mode.
    
    Theses modifications aim to be removed as soon as possible. It should
    be moved either in a platform specific boot-wrapper (which will be start
    before Xen), or in the bootloader (assuming U-Boot/Grub will support SMP).
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S                |   19 +++++++-
 xen/arch/arm/arm32/mode_switch.S         |   75 ++++++++++++++++++++++-------
 xen/include/asm-arm/platforms/vexpress.h |   11 ++++
 3 files changed, 86 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index d452b59..ec7f640 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -76,7 +76,7 @@ past_zImage:
         cpsid aif                    /* Disable all interrupts */
 
         /* Save the bootloader arguments in less-clobberable registers */
-        /* No need to save r1 == Unused ARM-linux machine type */
+        mov   r5, r1                 /* r5: ARM-linux machine type */
         mov   r8, r2                 /* r8 := DTB base address */
 
         /* Find out where we are */
@@ -119,11 +119,25 @@ boot_cpu:
         bl    putn
         PRINT(" booting -\r\n")
 #endif
+        /* Secondary CPUs doesn't have machine ID
+         *  - Store machine ID on boot CPU
+         *  - Load machine ID on secondary CPUs
+         * Machine ID is needed in kick_cpus and enter_hyp_mode */
+        ldr   r0, =machine_id           /* VA of machine_id */
+        add   r0, r0, r10               /* PA of machine_id */
+        teq   r12, #0
+        streq r5, [r0]                  /* On boot CPU save machine ID */
+        ldrne r5, [r0]                  /* If non boot cpu r5 := machine ID */
 
         /* Wake up secondary cpus */
         teq   r12, #0
         bleq  kick_cpus
 
+        PRINT("- Machine ID ")
+        mov   r0, r5
+        bl    putn
+        PRINT(" -\r\n")
+
         /* Check that this CPU has Hyp mode */
         mrc   CP32(r0, ID_PFR1)
         and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
@@ -403,6 +417,9 @@ putn:   mov   pc, lr
 
 #endif /* !EARLY_PRINTK */
 
+/* Place holder for machine ID */
+machine_id: .word 0x0
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/arm32/mode_switch.S b/xen/arch/arm/arm32/mode_switch.S
index d6741d0..c92a1cf 100644
--- a/xen/arch/arm/arm32/mode_switch.S
+++ b/xen/arch/arm/arm32/mode_switch.S
@@ -20,14 +20,21 @@
 #include <asm/config.h>
 #include <asm/page.h>
 #include <asm/platforms/vexpress.h>
+#include <asm/platforms/exynos5.h>
 #include <asm/asm_defns.h>
 #include <asm/gic.h>
 
-
-/* XXX: Versatile Express specific code */
-/* wake up secondary cpus */
+/* Wake up secondary cpus
+ * This code relies on Machine ID and only works for Vexpress and the Arndale
+ * TODO: Move this code either later (via platform specific desc) or in a bootwrapper
+ * r5: Machine ID
+ * Clobber r0 r2 */
 .globl kick_cpus
 kick_cpus:
+        ldr   r0, =MACH_TYPE_SMDK5250
+        teq   r5, r0                          /* Are we running on the arndale? */
+        beq   kick_cpus_arndale
+        /* otherwise versatile express */
         /* write start paddr to v2m sysreg FLAGSSET register */
         ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
         dsb
@@ -38,8 +45,20 @@ kick_cpus:
         add   r2, r2, r10
         str   r2, [r0, #(V2M_SYS_FLAGSSET)]
         dsb
+        ldr   r2, =V2M_GIC_BASE_ADDRESS       /* r2 := VE gic base address */
+        b     kick_cpus_sgi
+kick_cpus_arndale:
+        /* write start paddr to CPU 1 sysreg register */
+        ldr   r0, =(S5P_PA_SYSRAM)
+        ldr   r2, =start
+        add   r2, r2, r10
+        str   r2, [r0]
+        dsb
+        ldr   r2, =EXYNOS5_GIC_BASE_ADDRESS   /* r2 := Exynos5 gic base address */
+kick_cpus_sgi:
         /* send an interrupt */
-        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+        ldr   r0, =GIC_DR_OFFSET              /* GIC distributor offset */
+        add   r0, r2                          /* r0 := r0 + gic base address */
         mov   r2, #0x1
         str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
         mov   r2, #0xfe0000
@@ -51,13 +70,15 @@ kick_cpus:
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
  *
- * Expects r12 == CPU number
+ * r5: Machine ID
+ * r12: CPU number
  *
- * This code is specific to the VE model, and not intended to be used
+ * This code is specific to the VE model/Arndale, 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. */
+ * in Hyp mode.
+ * Clobber r0 - r4 */
 
 .globl enter_hyp_mode
 enter_hyp_mode:
@@ -68,33 +89,51 @@ enter_hyp_mode:
         orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
         bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
         mcr   CP32(r0, SCR)
+
+        ldr   r2, =MACH_TYPE_SMDK5250   /* r4 := Arndale machine ID */
+        /* By default load Arndale defaults values */
+        ldr   r0, =EXYNOS5_TIMER_FREQUENCY  /* r0 := timer's frequency */
+        ldr   r1, =EXYNOS5_GIC_BASE_ADDRESS /* r1 := GIC base address */
+        /* If it's not the Arndale machine ID, load VE values */
+        teq   r5, r2
+        ldrne r0, =V2M_TIMER_FREQUENCY
+        ldrne r1, =V2M_GIC_BASE_ADDRESS
+
         /* 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 */
+         * right frequency. */
         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
+
+        add   r0, r1, #GIC_DR_OFFSET
         /* Disable the GIC distributor, on the boot CPU only */
-        mov   r1, #0
+        mov   r4, #0
         teq   r12, #0                /* Is this the boot CPU? */
-        streq r1, [r0]
+        streq r4, [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) */
+        teq   r12, #0                /* Boot CPU? */
+        bne   skip_spis              /* Don't route SPIs on secondary CPUs */
+
+        add   r4, r1, #GIC_DR_OFFSET
+        ldr   r4, [r4, #4]            /* r4 := Interrupt Controller Type Reg */
+        and   r4, r4, #GICD_TYPE_LINES /* r4 := number of SPIs */
+1:      teq   r4, #0
+        beq   skip_spis
+        add   r0, r0, #4             /* Go to the new group */
+        str   r2, [r0]               /* Update the group */
+        sub  r4, r4, #1
+        b     1b
+skip_spis:
         /* Disable the GIC CPU interface on all processors */
-        mov   r0, #GIC_BASE_ADDRESS
-        add   r0, r0, #GIC_CR_OFFSET
+        add   r0, r1, #GIC_CR_OFFSET
         mov   r1, #0
         str   r1, [r0]
         /* Must drop priority mask below 0x80 before entering NS state */
diff --git a/xen/include/asm-arm/platforms/vexpress.h b/xen/include/asm-arm/platforms/vexpress.h
index 5cf3aba..982a293 100644
--- a/xen/include/asm-arm/platforms/vexpress.h
+++ b/xen/include/asm-arm/platforms/vexpress.h
@@ -32,6 +32,17 @@
 int vexpress_syscfg(int write, int function, int device, uint32_t *data);
 #endif
 
+/* Constants below is only used in assembly because the DTS is not yet parsed */
+#ifdef __ASSEMBLY__
+
+/* GIC base address */
+#define V2M_GIC_BASE_ADDRESS        0x2c000000
+
+/* Timer's frequency */
+#define V2M_TIMER_FREQUENCY         0x5f5e100 /* 100 Mhz */
+
+#endif /* __ASSEMBLY__ */
+
 #endif /* __ASM_ARM_PLATFORMS_VEXPRESS_H */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6QK-0004ag-9U; Tue, 14 May 2013 04:01:12 +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 1Uc6QI-0004aC-1D
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:10 +0000
Received: from [85.158.138.51:20888] by server-7.bemta-3.messagelabs.com id
	F3/7A-10169-407B1915; Tue, 14 May 2013 04:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1368504065!29333831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_32,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 487 invoked from network); 14 May 2013 04:01:06 -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;
	14 May 2013 04:01: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 1Uc6QD-0003Np-7p
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6QD-0006ec-6B
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:05 +0000
Date: Tue, 14 May 2013 04:01:05 +0000
Message-Id: <E1Uc6QD-0006ec-6B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: Remove hardcoded value for
	gic in assembly 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

commit d0d7f4de85e70595b5b6a77a1f0105b930ca82bd
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 21:14:21 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:02 2013 +0100

    xen/arm64: Remove hardcoded value for gic in assembly code
    
    - arm64: use V2M_GIC_BASE_ADDRESS
    - only expose GIC_*_ADDRESS to assembly. The C code uses base addresses
    provide by the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/mode_switch.S |    7 ++++---
 xen/include/asm-arm/config.h     |    8 ++++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/arm64/mode_switch.S b/xen/arch/arm/arm64/mode_switch.S
index 4c38181..d115706 100644
--- a/xen/arch/arm/arm64/mode_switch.S
+++ b/xen/arch/arm/arm64/mode_switch.S
@@ -21,6 +21,7 @@
 #include <asm/config.h>
 #include <asm/page.h>
 #include <asm/asm_defns.h>
+#include <asm/platforms/vexpress.h>
 
 /* Get up a CPU into EL2.  Clobbers x0-x3.
  *
@@ -53,18 +54,18 @@ enter_el2_mode:
          */
         cbnz    x22, 1f
 
-        ldr     x1, =(GIC_BASE_ADDRESS+GIC_DR_OFFSET) // GICD_CTLR
+        ldr     x1, =(V2M_GIC_BASE_ADDRESS+GIC_DR_OFFSET) // GICD_CTLR
         mov     w0, #3                          // EnableGrp0 | EnableGrp1
         str     w0, [x1]
 
-1:      ldr     x1, =(GIC_BASE_ADDRESS+GIC_DR_OFFSET+0x80) // GICD_IGROUPR
+1:      ldr     x1, =(V2M_GIC_BASE_ADDRESS+GIC_DR_OFFSET+0x80) // GICD_IGROUPR
         mov     w0, #~0                         // Grp1 interrupts
         str     w0, [x1], #4
         b.ne    2f                              // Only local interrupts for secondary CPUs
         str     w0, [x1], #4
         str     w0, [x1], #4
 
-2:      ldr     x1, =(GIC_BASE_ADDRESS+GIC_CR_OFFSET) // GICC_CTLR
+2:      ldr     x1, =(V2M_GIC_BASE_ADDRESS+GIC_CR_OFFSET) // GICC_CTLR
         ldr     w0, [x1]
         mov     w0, #3                          // EnableGrp0 | EnableGrp1
         str     w0, [x1]
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 6414c89..e3cfaf1 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -141,12 +141,16 @@ extern unsigned long frametable_virt_end;
 #define watchdog_disable() ((void)0)
 #define watchdog_enable()  ((void)0)
 
-/* Board-specific: base address of GIC + its regs */
-#define GIC_BASE_ADDRESS 0x2c000000
+#ifdef __ASSEMBLY__
+/* Board-specific: regs base address for the GIC
+ * Theses constants are only intend to be used in assembly file
+ * because the DT is not yet parsed.
+ */
 #define GIC_DR_OFFSET 0x1000
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
+#endif /* __ASSEMBLY__ */
 
 #endif /* __ARM_CONFIG_H__ */
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6QK-0004ag-9U; Tue, 14 May 2013 04:01:12 +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 1Uc6QI-0004aC-1D
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:10 +0000
Received: from [85.158.138.51:20888] by server-7.bemta-3.messagelabs.com id
	F3/7A-10169-407B1915; Tue, 14 May 2013 04:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1368504065!29333831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_32,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 487 invoked from network); 14 May 2013 04:01:06 -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;
	14 May 2013 04:01: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 1Uc6QD-0003Np-7p
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6QD-0006ec-6B
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:05 +0000
Date: Tue, 14 May 2013 04:01:05 +0000
Message-Id: <E1Uc6QD-0006ec-6B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: Remove hardcoded value for
	gic in assembly 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

commit d0d7f4de85e70595b5b6a77a1f0105b930ca82bd
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Apr 28 21:14:21 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 12:00:02 2013 +0100

    xen/arm64: Remove hardcoded value for gic in assembly code
    
    - arm64: use V2M_GIC_BASE_ADDRESS
    - only expose GIC_*_ADDRESS to assembly. The C code uses base addresses
    provide by the device tree
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/mode_switch.S |    7 ++++---
 xen/include/asm-arm/config.h     |    8 ++++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/arm64/mode_switch.S b/xen/arch/arm/arm64/mode_switch.S
index 4c38181..d115706 100644
--- a/xen/arch/arm/arm64/mode_switch.S
+++ b/xen/arch/arm/arm64/mode_switch.S
@@ -21,6 +21,7 @@
 #include <asm/config.h>
 #include <asm/page.h>
 #include <asm/asm_defns.h>
+#include <asm/platforms/vexpress.h>
 
 /* Get up a CPU into EL2.  Clobbers x0-x3.
  *
@@ -53,18 +54,18 @@ enter_el2_mode:
          */
         cbnz    x22, 1f
 
-        ldr     x1, =(GIC_BASE_ADDRESS+GIC_DR_OFFSET) // GICD_CTLR
+        ldr     x1, =(V2M_GIC_BASE_ADDRESS+GIC_DR_OFFSET) // GICD_CTLR
         mov     w0, #3                          // EnableGrp0 | EnableGrp1
         str     w0, [x1]
 
-1:      ldr     x1, =(GIC_BASE_ADDRESS+GIC_DR_OFFSET+0x80) // GICD_IGROUPR
+1:      ldr     x1, =(V2M_GIC_BASE_ADDRESS+GIC_DR_OFFSET+0x80) // GICD_IGROUPR
         mov     w0, #~0                         // Grp1 interrupts
         str     w0, [x1], #4
         b.ne    2f                              // Only local interrupts for secondary CPUs
         str     w0, [x1], #4
         str     w0, [x1], #4
 
-2:      ldr     x1, =(GIC_BASE_ADDRESS+GIC_CR_OFFSET) // GICC_CTLR
+2:      ldr     x1, =(V2M_GIC_BASE_ADDRESS+GIC_CR_OFFSET) // GICC_CTLR
         ldr     w0, [x1]
         mov     w0, #3                          // EnableGrp0 | EnableGrp1
         str     w0, [x1]
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 6414c89..e3cfaf1 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -141,12 +141,16 @@ extern unsigned long frametable_virt_end;
 #define watchdog_disable() ((void)0)
 #define watchdog_enable()  ((void)0)
 
-/* Board-specific: base address of GIC + its regs */
-#define GIC_BASE_ADDRESS 0x2c000000
+#ifdef __ASSEMBLY__
+/* Board-specific: regs base address for the GIC
+ * Theses constants are only intend to be used in assembly file
+ * because the DT is not yet parsed.
+ */
 #define GIC_DR_OFFSET 0x1000
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
+#endif /* __ASSEMBLY__ */
 
 #endif /* __ARM_CONFIG_H__ */
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6QR-0004cN-Hf; Tue, 14 May 2013 04:01: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 1Uc6QQ-0004by-8X
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:18 +0000
Received: from [85.158.139.211:41446] by server-12.bemta-5.messagelabs.com id
	33/9E-16465-D07B1915; Tue, 14 May 2013 04:01:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1368504075!20057037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25760 invoked from network); 14 May 2013 04:01:16 -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;
	14 May 2013 04:01: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 1Uc6QN-0003Nt-Dc
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6QN-0006fZ-BO
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:15 +0000
Date: Tue, 14 May 2013 04:01:15 +0000
Message-Id: <E1Uc6QN-0006fZ-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] also move compat mode
	VCPUOP_register_vcpu_info into 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

commit 00c1c1f045b2051dde6b3bcb06b9570833859a45
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 13 14:36:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 13 14:36:06 2013 +0200

    also move compat mode VCPUOP_register_vcpu_info into common code
    
    Otherwise, with arch_compat_vcpu_op() calling arch_do_vcpu_op() to
    handle it, it results in -ENOSYS after 6ff9e4f7 ("xen: move
    VCPUOP_register_vcpu_info to common code") for 32-bit x86 domains.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/x86_64/domain.c |    9 ---------
 xen/common/compat/domain.c   |    9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/x86_64/domain.c b/xen/arch/x86/x86_64/domain.c
index d630ef4..2096b2c 100644
--- a/xen/arch/x86/x86_64/domain.c
+++ b/xen/arch/x86/x86_64/domain.c
@@ -9,14 +9,6 @@
 #include <xen/hypercall.h>
 #include <compat/vcpu.h>
 
-#define xen_vcpu_info vcpu_info
-CHECK_SIZE_(struct, vcpu_info);
-#undef xen_vcpu_info
-
-#define xen_vcpu_register_vcpu_info vcpu_register_vcpu_info
-CHECK_vcpu_register_vcpu_info;
-#undef xen_vcpu_register_vcpu_info
-
 #define xen_vcpu_get_physid vcpu_get_physid
 CHECK_vcpu_get_physid;
 #undef xen_vcpu_get_physid
@@ -63,7 +55,6 @@ arch_compat_vcpu_op(
         break;
     }
 
-    case VCPUOP_register_vcpu_info:
     case VCPUOP_get_physid:
         rc = arch_do_vcpu_op(cmd, v, arg);
         break;
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 44ba78d..e756f54 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -15,6 +15,14 @@
 CHECK_vcpu_set_periodic_timer;
 #undef xen_vcpu_set_periodic_timer
 
+#define xen_vcpu_info vcpu_info
+CHECK_SIZE_(struct, vcpu_info);
+#undef xen_vcpu_info
+
+#define xen_vcpu_register_vcpu_info vcpu_register_vcpu_info
+CHECK_vcpu_register_vcpu_info;
+#undef xen_vcpu_register_vcpu_info
+
 int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
@@ -64,6 +72,7 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
     case VCPUOP_set_periodic_timer:
     case VCPUOP_stop_periodic_timer:
     case VCPUOP_stop_singleshot_timer:
+    case VCPUOP_register_vcpu_info:
     case VCPUOP_send_nmi:
         rc = do_vcpu_op(cmd, vcpuid, arg);
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6QR-0004cN-Hf; Tue, 14 May 2013 04:01: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 1Uc6QQ-0004by-8X
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:18 +0000
Received: from [85.158.139.211:41446] by server-12.bemta-5.messagelabs.com id
	33/9E-16465-D07B1915; Tue, 14 May 2013 04:01:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1368504075!20057037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25760 invoked from network); 14 May 2013 04:01:16 -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;
	14 May 2013 04:01: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 1Uc6QN-0003Nt-Dc
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6QN-0006fZ-BO
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:15 +0000
Date: Tue, 14 May 2013 04:01:15 +0000
Message-Id: <E1Uc6QN-0006fZ-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] also move compat mode
	VCPUOP_register_vcpu_info into 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

commit 00c1c1f045b2051dde6b3bcb06b9570833859a45
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 13 14:36:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 13 14:36:06 2013 +0200

    also move compat mode VCPUOP_register_vcpu_info into common code
    
    Otherwise, with arch_compat_vcpu_op() calling arch_do_vcpu_op() to
    handle it, it results in -ENOSYS after 6ff9e4f7 ("xen: move
    VCPUOP_register_vcpu_info to common code") for 32-bit x86 domains.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/x86_64/domain.c |    9 ---------
 xen/common/compat/domain.c   |    9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/x86_64/domain.c b/xen/arch/x86/x86_64/domain.c
index d630ef4..2096b2c 100644
--- a/xen/arch/x86/x86_64/domain.c
+++ b/xen/arch/x86/x86_64/domain.c
@@ -9,14 +9,6 @@
 #include <xen/hypercall.h>
 #include <compat/vcpu.h>
 
-#define xen_vcpu_info vcpu_info
-CHECK_SIZE_(struct, vcpu_info);
-#undef xen_vcpu_info
-
-#define xen_vcpu_register_vcpu_info vcpu_register_vcpu_info
-CHECK_vcpu_register_vcpu_info;
-#undef xen_vcpu_register_vcpu_info
-
 #define xen_vcpu_get_physid vcpu_get_physid
 CHECK_vcpu_get_physid;
 #undef xen_vcpu_get_physid
@@ -63,7 +55,6 @@ arch_compat_vcpu_op(
         break;
     }
 
-    case VCPUOP_register_vcpu_info:
     case VCPUOP_get_physid:
         rc = arch_do_vcpu_op(cmd, v, arg);
         break;
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 44ba78d..e756f54 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -15,6 +15,14 @@
 CHECK_vcpu_set_periodic_timer;
 #undef xen_vcpu_set_periodic_timer
 
+#define xen_vcpu_info vcpu_info
+CHECK_SIZE_(struct, vcpu_info);
+#undef xen_vcpu_info
+
+#define xen_vcpu_register_vcpu_info vcpu_register_vcpu_info
+CHECK_vcpu_register_vcpu_info;
+#undef xen_vcpu_register_vcpu_info
+
 int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d = current->domain;
@@ -64,6 +72,7 @@ int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
     case VCPUOP_set_periodic_timer:
     case VCPUOP_stop_periodic_timer:
     case VCPUOP_stop_singleshot_timer:
+    case VCPUOP_register_vcpu_info:
     case VCPUOP_send_nmi:
         rc = do_vcpu_op(cmd, vcpuid, arg);
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6Qb-0004eM-L6; Tue, 14 May 2013 04:01:29 +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 1Uc6Qa-0004dw-H8
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:28 +0000
Received: from [85.158.139.83:44117] by server-1.bemta-5.messagelabs.com id
	2F/A3-01720-717B1915; Tue, 14 May 2013 04:01:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1368504085!21152488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17368 invoked from network); 14 May 2013 04:01:26 -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;
	14 May 2013 04:01:26 -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 1Uc6QX-0003O1-J5
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6QX-0006g2-HT
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:25 +0000
Date: Tue, 14 May 2013 04:01:25 +0000
Message-Id: <E1Uc6QX-0006g2-HT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Use {git, hg,
	svn} commit id if available for xen_changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4d710aa8854784bf556aca16ba47b3ba39ce1275
Author:     Marek Marczykowski <marmarek@invisiblethingslab.com>
AuthorDate: Thu May 9 01:07:05 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 14:07:39 2013 +0100

    Use {git, hg, svn} commit id if available for xen_changeset
    
    As Xen uses git as primary repository, get git commit id for
    xen_changeset info.
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/Makefile         |    2 +-
 xen/tools/scmversion |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 0fb3db7..201d9bc 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -126,7 +126,7 @@ include/xen/compile.h: include/xen/compile.h.in .banner
 	    -e 's/@@version@@/$(XEN_VERSION)/g' \
 	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
 	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
-	    -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date} {rev}:{node|short}" >/dev/null && hg parents --template "{date|date} {rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
+	    -e 's!@@changeset@@!$(shell tools/scmversion $(XEN_ROOT) || echo "unavailable")!g' \
 	    < include/xen/compile.h.in > $@.new
 	@grep \" .banner >> $@.new
 	@grep -v \" .banner
diff --git a/xen/tools/scmversion b/xen/tools/scmversion
new file mode 100755
index 0000000..219d898
--- /dev/null
+++ b/xen/tools/scmversion
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# This scripts adds local version information from the version
+# control systems git, mercurial (hg) and subversion (svn).
+#
+# If something goes wrong, send a mail the kernel build mailinglist
+# (see MAINTAINERS) and CC Nico Schottelius
+# <nico-linuxsetlocalversion -at- schottelius.org>.
+#
+# Based on setlocalversion from Linux kernel
+#
+#
+
+usage() {
+	echo "Usage: $0 [--save-scmversion] [srctree]" >&2
+	exit 1
+}
+
+scm_only=false
+srctree=.
+if test "$1" = "--save-scmversion"; then
+	scm_only=true
+	shift
+fi
+if test $# -gt 0; then
+	srctree=$1
+	shift
+fi
+if test $# -gt 0 -o ! -d "$srctree"; then
+	usage
+fi
+
+scm_version()
+{
+	local short
+	short=false
+
+	cd "$srctree"
+	if test -e .scmversion; then
+		cat .scmversion
+		return
+	fi
+	if test "$1" = "--short"; then
+		short=true
+	fi
+
+	# Check for git and a git repo.
+	if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
+		date=`git show -s --pretty="%ad" HEAD`
+
+		printf '%s %s%s' "$date" git: $head
+
+		# Is this git on svn?
+		if git config --get svn-remote.svn.url >/dev/null; then
+			printf -- 'svn:%s' "`git svn find-rev $head`"
+		fi
+
+		# Update index only on r/w media
+		[ -w . ] && git update-index --refresh --unmerged > /dev/null
+
+		# Check for uncommitted changes
+		if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
+			printf '%s' -dirty
+		fi
+
+		# All done with git
+		return
+	fi
+
+	# Check for mercurial and a mercurial repo.
+	if test -d .hg && hgid=`hg id 2>/dev/null`; then
+		id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
+		date=`hg parents --template "{date|date}"`
+		printf '%s %s%s' "$date" hg: "$id"
+
+		# Are there uncommitted changes?
+		# These are represented by + after the changeset id.
+		case "$hgid" in
+			*+|*+\ *) printf '%s' -dirty ;;
+		esac
+
+		# All done with mercurial
+		return
+	fi
+
+	# Check for svn and a svn repo.
+	if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
+		rev=`echo $rev | awk '{print $NF}'`
+		printf -- 'svn:%s' "$rev"
+
+		# All done with svn
+		return
+	fi
+}
+
+cd $srctree
+
+# full scm version string
+res="$(scm_version)"
+
+echo "$res"
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6Qb-0004eM-L6; Tue, 14 May 2013 04:01:29 +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 1Uc6Qa-0004dw-H8
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:28 +0000
Received: from [85.158.139.83:44117] by server-1.bemta-5.messagelabs.com id
	2F/A3-01720-717B1915; Tue, 14 May 2013 04:01:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1368504085!21152488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17368 invoked from network); 14 May 2013 04:01:26 -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;
	14 May 2013 04:01:26 -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 1Uc6QX-0003O1-J5
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6QX-0006g2-HT
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:25 +0000
Date: Tue, 14 May 2013 04:01:25 +0000
Message-Id: <E1Uc6QX-0006g2-HT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Use {git, hg,
	svn} commit id if available for xen_changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4d710aa8854784bf556aca16ba47b3ba39ce1275
Author:     Marek Marczykowski <marmarek@invisiblethingslab.com>
AuthorDate: Thu May 9 01:07:05 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 14:07:39 2013 +0100

    Use {git, hg, svn} commit id if available for xen_changeset
    
    As Xen uses git as primary repository, get git commit id for
    xen_changeset info.
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/Makefile         |    2 +-
 xen/tools/scmversion |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 0fb3db7..201d9bc 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -126,7 +126,7 @@ include/xen/compile.h: include/xen/compile.h.in .banner
 	    -e 's/@@version@@/$(XEN_VERSION)/g' \
 	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
 	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
-	    -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date} {rev}:{node|short}" >/dev/null && hg parents --template "{date|date} {rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
+	    -e 's!@@changeset@@!$(shell tools/scmversion $(XEN_ROOT) || echo "unavailable")!g' \
 	    < include/xen/compile.h.in > $@.new
 	@grep \" .banner >> $@.new
 	@grep -v \" .banner
diff --git a/xen/tools/scmversion b/xen/tools/scmversion
new file mode 100755
index 0000000..219d898
--- /dev/null
+++ b/xen/tools/scmversion
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# This scripts adds local version information from the version
+# control systems git, mercurial (hg) and subversion (svn).
+#
+# If something goes wrong, send a mail the kernel build mailinglist
+# (see MAINTAINERS) and CC Nico Schottelius
+# <nico-linuxsetlocalversion -at- schottelius.org>.
+#
+# Based on setlocalversion from Linux kernel
+#
+#
+
+usage() {
+	echo "Usage: $0 [--save-scmversion] [srctree]" >&2
+	exit 1
+}
+
+scm_only=false
+srctree=.
+if test "$1" = "--save-scmversion"; then
+	scm_only=true
+	shift
+fi
+if test $# -gt 0; then
+	srctree=$1
+	shift
+fi
+if test $# -gt 0 -o ! -d "$srctree"; then
+	usage
+fi
+
+scm_version()
+{
+	local short
+	short=false
+
+	cd "$srctree"
+	if test -e .scmversion; then
+		cat .scmversion
+		return
+	fi
+	if test "$1" = "--short"; then
+		short=true
+	fi
+
+	# Check for git and a git repo.
+	if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
+		date=`git show -s --pretty="%ad" HEAD`
+
+		printf '%s %s%s' "$date" git: $head
+
+		# Is this git on svn?
+		if git config --get svn-remote.svn.url >/dev/null; then
+			printf -- 'svn:%s' "`git svn find-rev $head`"
+		fi
+
+		# Update index only on r/w media
+		[ -w . ] && git update-index --refresh --unmerged > /dev/null
+
+		# Check for uncommitted changes
+		if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
+			printf '%s' -dirty
+		fi
+
+		# All done with git
+		return
+	fi
+
+	# Check for mercurial and a mercurial repo.
+	if test -d .hg && hgid=`hg id 2>/dev/null`; then
+		id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
+		date=`hg parents --template "{date|date}"`
+		printf '%s %s%s' "$date" hg: "$id"
+
+		# Are there uncommitted changes?
+		# These are represented by + after the changeset id.
+		case "$hgid" in
+			*+|*+\ *) printf '%s' -dirty ;;
+		esac
+
+		# All done with mercurial
+		return
+	fi
+
+	# Check for svn and a svn repo.
+	if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
+		rev=`echo $rev | awk '{print $NF}'`
+		printf -- 'svn:%s' "$rev"
+
+		# All done with svn
+		return
+	fi
+}
+
+cd $srctree
+
+# full scm version string
+res="$(scm_version)"
+
+echo "$res"
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6Qp-0004gf-O4; Tue, 14 May 2013 04:01: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 1Uc6Qo-0004gF-2h
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:42 +0000
Received: from [193.109.254.147:41003] by server-3.bemta-14.messagelabs.com id
	70/CA-06484-527B1915; Tue, 14 May 2013 04:01:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368504096!8950045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29009 invoked from network); 14 May 2013 04:01:37 -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;
	14 May 2013 04:01:37 -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 1Uc6Qh-0003O9-Ok
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Qh-0006gY-Nl
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:35 +0000
Date: Tue, 14 May 2013 04:01:35 +0000
Message-Id: <E1Uc6Qh-0006gY-Nl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update SEABIOS_UPSTREAM_TAG
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 abf04cf04f5b6f2ce22e9f7966d63303b9487d81
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri May 10 12:09:24 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 14:07:48 2013 +0100

    Update SEABIOS_UPSTREAM_TAG
    
    Pull in two fixes for newer IASL compilers.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index f270b36..dc0d49e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -213,9 +213,9 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.0-rc1
-SEABIOS_UPSTREAM_TAG ?= rel-1.7.1
-# Wed Aug 29 21:27:37 2012 -0400
-# Make iasl option check work with older versions of iasl.
+SEABIOS_UPSTREAM_TAG ?= 30ef08fb25af278ba012efd8b2c0050c108be54d
+# Sun Feb 10 21:06:14 2013 -0500
+# Update tools/acpi_extract.py to handle iasl 20130117 release.
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 04:01:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 04:01: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 1Uc6Qp-0004gf-O4; Tue, 14 May 2013 04:01: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 1Uc6Qo-0004gF-2h
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:42 +0000
Received: from [193.109.254.147:41003] by server-3.bemta-14.messagelabs.com id
	70/CA-06484-527B1915; Tue, 14 May 2013 04:01:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1368504096!8950045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29009 invoked from network); 14 May 2013 04:01:37 -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;
	14 May 2013 04:01:37 -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 1Uc6Qh-0003O9-Ok
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uc6Qh-0006gY-Nl
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 04:01:35 +0000
Date: Tue, 14 May 2013 04:01:35 +0000
Message-Id: <E1Uc6Qh-0006gY-Nl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update SEABIOS_UPSTREAM_TAG
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 abf04cf04f5b6f2ce22e9f7966d63303b9487d81
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri May 10 12:09:24 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon May 13 14:07:48 2013 +0100

    Update SEABIOS_UPSTREAM_TAG
    
    Pull in two fixes for newer IASL compilers.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index f270b36..dc0d49e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -213,9 +213,9 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.0-rc1
-SEABIOS_UPSTREAM_TAG ?= rel-1.7.1
-# Wed Aug 29 21:27:37 2012 -0400
-# Make iasl option check work with older versions of iasl.
+SEABIOS_UPSTREAM_TAG ?= 30ef08fb25af278ba012efd8b2c0050c108be54d
+# Sun Feb 10 21:06:14 2013 -0500
+# Update tools/acpi_extract.py to handle iasl 20130117 release.
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16: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 1UcIA2-00081R-Uk; Tue, 14 May 2013 16:33: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 1UcIA1-000819-J8
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:09 +0000
Received: from [193.109.254.147:24066] by server-3.bemta-14.messagelabs.com id
	02/06-06484-44762915; Tue, 14 May 2013 16:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1368549184!2461323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30962 invoked from network); 14 May 2013 16:33: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;
	14 May 2013 16:33: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 1UcI9v-000470-T8
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcI9v-0008T5-M1
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:03 +0000
Date: Tue, 14 May 2013 16:33:03 +0000
Message-Id: <E1UcI9v-0008T5-M1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hypervisor/xen/tools: Remove the
	XENMEM_get_oustanding_pages and provide the data via xc_phys_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 bec8f17e48439ee5b8370f4e431ccd9a9514bee7
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:11 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:01:50 2013 +0100

    hypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data via xc_phys_info
    
    During the review of the patches it was noticed that there exists
    a race wherein the 'free_memory' value consists of information from
    two hypercalls. That is the XEN_SYSCTL_physinfo and XENMEM_get_outstanding_pages.
    
    The free memory the host has available for guest is the difference between
    the 'free_pages' (from XEN_SYSCTL_physinfo) and 'outstanding_pages'. As they
    are two hypercalls many things can happen in between the execution of them.
    
    This patch resolves this by eliminating the XENMEM_get_outstanding_pages
    hypercall and providing the free_pages and outstanding_pages information
    via the xc_phys_info structure.
    
    It also removes the XSM hooks and adds locking as needed.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir.xen@gmail.com>
---
 tools/libxc/xc_domain.c             |    9 ---------
 tools/libxc/xenctrl.h               |    2 --
 tools/libxl/libxl.c                 |   15 +--------------
 tools/libxl/libxl.h                 |    1 -
 tools/libxl/libxl_types.idl         |    1 +
 tools/libxl/xl_cmdimpl.c            |   16 +++-------------
 xen/common/memory.c                 |    8 --------
 xen/common/page_alloc.c             |    7 +++++--
 xen/common/sysctl.c                 |    3 ++-
 xen/include/public/memory.h         |    7 -------
 xen/include/public/sysctl.h         |    3 ++-
 xen/include/xen/mm.h                |    2 +-
 xen/include/xsm/dummy.h             |    6 ------
 xen/include/xsm/xsm.h               |    6 ------
 xen/xsm/dummy.c                     |    1 -
 xen/xsm/flask/hooks.c               |    7 -------
 xen/xsm/flask/policy/access_vectors |    2 +-
 17 files changed, 16 insertions(+), 80 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index bb71cca..3257e2a 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -873,15 +873,6 @@ int xc_domain_claim_pages(xc_interface *xch,
         err = errno = 0;
     return err;
 }
-unsigned long xc_domain_get_outstanding_pages(xc_interface *xch)
-{
-    long ret = do_memory_op(xch, XENMEM_get_outstanding_pages, NULL, 0);
-
-    /* Ignore it if the hypervisor does not support the call. */
-    if (ret == -1 && errno == ENOSYS)
-        ret = errno = 0;
-    return ret;
-}
 
 int xc_domain_populate_physmap(xc_interface *xch,
                                uint32_t domid,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index c024af4..40ee8fc 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1182,8 +1182,6 @@ int xc_domain_claim_pages(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_pages);
 
-unsigned long xc_domain_get_outstanding_pages(xc_interface *xch);
-
 int xc_domain_memory_exchange_pages(xc_interface *xch,
                                     int domid,
                                     unsigned long nr_in_extents,
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index bc91fd5..ee1fa9c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3942,6 +3942,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     physinfo->total_pages = xcphysinfo.total_pages;
     physinfo->free_pages = xcphysinfo.free_pages;
     physinfo->scrub_pages = xcphysinfo.scrub_pages;
+    physinfo->outstanding_pages = xcphysinfo.outstanding_pages;
     l = xc_sharing_freed_pages(ctx->xch);
     if (l == -ENOSYS) {
         l = 0;
@@ -4105,20 +4106,6 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
     return ret;
 }
 
-uint64_t libxl_get_claiminfo(libxl_ctx *ctx)
-{
-    long l;
-
-    l = xc_domain_get_outstanding_pages(ctx->xch);
-    if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_WARNING, l,
-                            "xc_domain_get_outstanding_pages failed.");
-        return ERROR_FAIL;
-    }
-    /* In pages */
-    return l;
-}
-
 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 {
     union {
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index ef96bce..0bc005e 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -624,7 +624,6 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k
 /* wait for the memory target of a domain to be reached */
 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
 
-uint64_t libxl_get_claiminfo(libxl_ctx *ctx);
 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type);
 /* libxl_primary_console_exec finds the domid and console number
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index ecf1f0b..8262cba 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -487,6 +487,7 @@ libxl_physinfo = Struct("physinfo", [
     ("total_pages", uint64),
     ("free_pages", uint64),
     ("scrub_pages", uint64),
+    ("outstanding_pages", uint64),
     ("sharing_freed_pages", uint64),
     ("sharing_used_frames", uint64),
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c1a969b..edf0325 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4576,21 +4576,11 @@ static void output_physinfo(void)
     unsigned int i;
     libxl_bitmap cpumap;
     int n = 0;
-    long claims = 0;
 
     if (libxl_get_physinfo(ctx, &info) != 0) {
         fprintf(stderr, "libxl_physinfo failed.\n");
         return;
     }
-    /*
-     * Don't bother checking "claim_mode" as user might have turned it off
-     * and we have outstanding claims.
-     */
-    if ((claims = libxl_get_claiminfo(ctx)) < 0){
-        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
-                errno, strerror(errno));
-        return;
-    }
     printf("nr_cpus                : %d\n", info.nr_cpus);
     printf("max_cpu_id             : %d\n", info.max_cpu_id);
     printf("nr_nodes               : %d\n", info.nr_nodes);
@@ -4610,15 +4600,15 @@ static void output_physinfo(void)
     if (vinfo) {
         i = (1 << 20) / vinfo->pagesize;
         printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
-        printf("free_memory            : %"PRIu64"\n", (info.free_pages - claims) / i);
+        printf("free_memory            : %"PRIu64"\n", (info.free_pages - info.outstanding_pages) / i);
         printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
         printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
     }
     /*
      * Only if enabled (claim_mode=1) or there are outstanding claims.
      */
-    if (libxl_defbool_val(claim_mode) || claims)
-        printf("outstanding_claims     : %ld\n", claims / i);
+    if (libxl_defbool_val(claim_mode) || info.outstanding_pages)
+        printf("outstanding_claims     : %"PRIu64"\n", info.outstanding_pages / i);
 
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_bit(i, cpumap)
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 3239d53..06a0d0a 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -737,14 +737,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         break;
 
-    case XENMEM_get_outstanding_pages:
-        rc = xsm_xenmem_get_outstanding_pages(XSM_PRIV);
-
-        if ( !rc )
-            rc = get_outstanding_claims();
-
-        break;
-
     default:
         rc = arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 203f77a..2162ef1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -380,9 +380,12 @@ out:
     return ret;
 }
 
-long get_outstanding_claims(void)
+void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages)
 {
-    return outstanding_claims;
+    spin_lock(&heap_lock);
+    *outstanding_pages = outstanding_claims;
+    *free_pages =  avail_domheap_pages();
+    spin_unlock(&heap_lock);
 }
 
 static unsigned long init_node_heap(int node, unsigned long mfn,
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 31f9650..117e095 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -264,7 +264,8 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         pi->max_node_id = MAX_NUMNODES-1;
         pi->max_cpu_id = nr_cpu_ids - 1;
         pi->total_pages = total_pages;
-        pi->free_pages = avail_domheap_pages();
+        /* Protected by lock */
+        get_outstanding_claims(&pi->free_pages, &pi->outstanding_pages);
         pi->scrub_pages = 0;
         pi->cpu_khz = cpu_khz;
         arch_do_physinfo(pi);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 51d5254..7a26dee 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -459,13 +459,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
  * The zero value is appropiate.
  */
 
-/*
- * Get the number of pages currently claimed (but not yet "possessed")
- * across all domains.  The caller must be privileged but otherwise
- * the call never fails.
- */
-#define XENMEM_get_outstanding_pages        25
-
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 03710d8..8437d31 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -34,7 +34,7 @@
 #include "xen.h"
 #include "domctl.h"
 
-#define XEN_SYSCTL_INTERFACE_VERSION 0x00000009
+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000A
 
 /*
  * Read console content from Xen buffer ring.
@@ -101,6 +101,7 @@ struct xen_sysctl_physinfo {
     uint64_aligned_t total_pages;
     uint64_aligned_t free_pages;
     uint64_aligned_t scrub_pages;
+    uint64_aligned_t outstanding_pages;
     uint32_t hw_cap[8];
 
     /* XEN_SYSCTL_PHYSCAP_??? */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index efc45c7..4f5795c 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -59,7 +59,7 @@ void destroy_xen_mappings(unsigned long v, unsigned long e);
 /* Claim handling */
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
 int domain_set_outstanding_pages(struct domain *d, unsigned long pages);
-long get_outstanding_claims(void);
+void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages);
 
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index a872056..cc0a5a8 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -259,12 +259,6 @@ static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_xenmem_get_outstanding_pages(XSM_DEFAULT_VOID)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, NULL);
-}
-
 static XSM_INLINE int xsm_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 58a4fbb..1939453 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -93,7 +93,6 @@ struct xsm_operations {
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
     int (*claim_pages) (struct domain *d);
-    int (*xenmem_get_outstanding_pages) (void);
 
     int (*console_io) (struct domain *d, int cmd);
 
@@ -360,11 +359,6 @@ static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
     return xsm_ops->claim_pages(d);
 }
 
-static inline int xsm_xenmem_get_outstanding_pages(xsm_default_t def)
-{
-    return xsm_ops->xenmem_get_outstanding_pages();
-}
-
 static inline int xsm_console_io (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->console_io(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 937761f..31e4f73 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -67,7 +67,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
     set_to_dummy_if_null(ops, claim_pages);
-    set_to_dummy_if_null(ops, xenmem_get_outstanding_pages);
 
     set_to_dummy_if_null(ops, console_io);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index bb10de3..fa0589a 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -422,12 +422,6 @@ static int flask_claim_pages(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETCLAIM);
 }
 
-static int flask_xenmem_get_outstanding_pages(void)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN,
-                                XEN__HEAP, NULL);
-}
-
 static int flask_console_io(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1504,7 +1498,6 @@ static struct xsm_operations flask_ops = {
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
     .claim_pages = flask_claim_pages,
-    .xenmem_get_outstanding_pages = flask_xenmem_get_outstanding_pages,
 
     .console_io = flask_console_io,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 544c3ba..5dfe13b 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -54,7 +54,7 @@ class xen
     debug
 # XEN_SYSCTL_getcpuinfo, XENPF_get_cpu_version, XENPF_get_cpuinfo
     getcpuinfo
-# XEN_SYSCTL_availheap, XENMEM_get_outstanding_pages
+# XEN_SYSCTL_availheap
     heap
 # XEN_SYSCTL_get_pmstat, XEN_SYSCTL_pm_op, XENPF_set_processor_pminfo,
 # XENPF_core_parking
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16: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 1UcIA2-00081R-Uk; Tue, 14 May 2013 16:33: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 1UcIA1-000819-J8
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:09 +0000
Received: from [193.109.254.147:24066] by server-3.bemta-14.messagelabs.com id
	02/06-06484-44762915; Tue, 14 May 2013 16:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1368549184!2461323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30962 invoked from network); 14 May 2013 16:33: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;
	14 May 2013 16:33: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 1UcI9v-000470-T8
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcI9v-0008T5-M1
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:03 +0000
Date: Tue, 14 May 2013 16:33:03 +0000
Message-Id: <E1UcI9v-0008T5-M1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hypervisor/xen/tools: Remove the
	XENMEM_get_oustanding_pages and provide the data via xc_phys_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 bec8f17e48439ee5b8370f4e431ccd9a9514bee7
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:11 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:01:50 2013 +0100

    hypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data via xc_phys_info
    
    During the review of the patches it was noticed that there exists
    a race wherein the 'free_memory' value consists of information from
    two hypercalls. That is the XEN_SYSCTL_physinfo and XENMEM_get_outstanding_pages.
    
    The free memory the host has available for guest is the difference between
    the 'free_pages' (from XEN_SYSCTL_physinfo) and 'outstanding_pages'. As they
    are two hypercalls many things can happen in between the execution of them.
    
    This patch resolves this by eliminating the XENMEM_get_outstanding_pages
    hypercall and providing the free_pages and outstanding_pages information
    via the xc_phys_info structure.
    
    It also removes the XSM hooks and adds locking as needed.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir.xen@gmail.com>
---
 tools/libxc/xc_domain.c             |    9 ---------
 tools/libxc/xenctrl.h               |    2 --
 tools/libxl/libxl.c                 |   15 +--------------
 tools/libxl/libxl.h                 |    1 -
 tools/libxl/libxl_types.idl         |    1 +
 tools/libxl/xl_cmdimpl.c            |   16 +++-------------
 xen/common/memory.c                 |    8 --------
 xen/common/page_alloc.c             |    7 +++++--
 xen/common/sysctl.c                 |    3 ++-
 xen/include/public/memory.h         |    7 -------
 xen/include/public/sysctl.h         |    3 ++-
 xen/include/xen/mm.h                |    2 +-
 xen/include/xsm/dummy.h             |    6 ------
 xen/include/xsm/xsm.h               |    6 ------
 xen/xsm/dummy.c                     |    1 -
 xen/xsm/flask/hooks.c               |    7 -------
 xen/xsm/flask/policy/access_vectors |    2 +-
 17 files changed, 16 insertions(+), 80 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index bb71cca..3257e2a 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -873,15 +873,6 @@ int xc_domain_claim_pages(xc_interface *xch,
         err = errno = 0;
     return err;
 }
-unsigned long xc_domain_get_outstanding_pages(xc_interface *xch)
-{
-    long ret = do_memory_op(xch, XENMEM_get_outstanding_pages, NULL, 0);
-
-    /* Ignore it if the hypervisor does not support the call. */
-    if (ret == -1 && errno == ENOSYS)
-        ret = errno = 0;
-    return ret;
-}
 
 int xc_domain_populate_physmap(xc_interface *xch,
                                uint32_t domid,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index c024af4..40ee8fc 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1182,8 +1182,6 @@ int xc_domain_claim_pages(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_pages);
 
-unsigned long xc_domain_get_outstanding_pages(xc_interface *xch);
-
 int xc_domain_memory_exchange_pages(xc_interface *xch,
                                     int domid,
                                     unsigned long nr_in_extents,
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index bc91fd5..ee1fa9c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3942,6 +3942,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
     physinfo->total_pages = xcphysinfo.total_pages;
     physinfo->free_pages = xcphysinfo.free_pages;
     physinfo->scrub_pages = xcphysinfo.scrub_pages;
+    physinfo->outstanding_pages = xcphysinfo.outstanding_pages;
     l = xc_sharing_freed_pages(ctx->xch);
     if (l == -ENOSYS) {
         l = 0;
@@ -4105,20 +4106,6 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
     return ret;
 }
 
-uint64_t libxl_get_claiminfo(libxl_ctx *ctx)
-{
-    long l;
-
-    l = xc_domain_get_outstanding_pages(ctx->xch);
-    if (l < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_WARNING, l,
-                            "xc_domain_get_outstanding_pages failed.");
-        return ERROR_FAIL;
-    }
-    /* In pages */
-    return l;
-}
-
 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 {
     union {
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index ef96bce..0bc005e 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -624,7 +624,6 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k
 /* wait for the memory target of a domain to be reached */
 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
 
-uint64_t libxl_get_claiminfo(libxl_ctx *ctx);
 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type);
 /* libxl_primary_console_exec finds the domid and console number
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index ecf1f0b..8262cba 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -487,6 +487,7 @@ libxl_physinfo = Struct("physinfo", [
     ("total_pages", uint64),
     ("free_pages", uint64),
     ("scrub_pages", uint64),
+    ("outstanding_pages", uint64),
     ("sharing_freed_pages", uint64),
     ("sharing_used_frames", uint64),
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c1a969b..edf0325 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4576,21 +4576,11 @@ static void output_physinfo(void)
     unsigned int i;
     libxl_bitmap cpumap;
     int n = 0;
-    long claims = 0;
 
     if (libxl_get_physinfo(ctx, &info) != 0) {
         fprintf(stderr, "libxl_physinfo failed.\n");
         return;
     }
-    /*
-     * Don't bother checking "claim_mode" as user might have turned it off
-     * and we have outstanding claims.
-     */
-    if ((claims = libxl_get_claiminfo(ctx)) < 0){
-        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
-                errno, strerror(errno));
-        return;
-    }
     printf("nr_cpus                : %d\n", info.nr_cpus);
     printf("max_cpu_id             : %d\n", info.max_cpu_id);
     printf("nr_nodes               : %d\n", info.nr_nodes);
@@ -4610,15 +4600,15 @@ static void output_physinfo(void)
     if (vinfo) {
         i = (1 << 20) / vinfo->pagesize;
         printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
-        printf("free_memory            : %"PRIu64"\n", (info.free_pages - claims) / i);
+        printf("free_memory            : %"PRIu64"\n", (info.free_pages - info.outstanding_pages) / i);
         printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
         printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
     }
     /*
      * Only if enabled (claim_mode=1) or there are outstanding claims.
      */
-    if (libxl_defbool_val(claim_mode) || claims)
-        printf("outstanding_claims     : %ld\n", claims / i);
+    if (libxl_defbool_val(claim_mode) || info.outstanding_pages)
+        printf("outstanding_claims     : %"PRIu64"\n", info.outstanding_pages / i);
 
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_bit(i, cpumap)
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 3239d53..06a0d0a 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -737,14 +737,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         break;
 
-    case XENMEM_get_outstanding_pages:
-        rc = xsm_xenmem_get_outstanding_pages(XSM_PRIV);
-
-        if ( !rc )
-            rc = get_outstanding_claims();
-
-        break;
-
     default:
         rc = arch_memory_op(op, arg);
         break;
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 203f77a..2162ef1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -380,9 +380,12 @@ out:
     return ret;
 }
 
-long get_outstanding_claims(void)
+void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages)
 {
-    return outstanding_claims;
+    spin_lock(&heap_lock);
+    *outstanding_pages = outstanding_claims;
+    *free_pages =  avail_domheap_pages();
+    spin_unlock(&heap_lock);
 }
 
 static unsigned long init_node_heap(int node, unsigned long mfn,
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 31f9650..117e095 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -264,7 +264,8 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         pi->max_node_id = MAX_NUMNODES-1;
         pi->max_cpu_id = nr_cpu_ids - 1;
         pi->total_pages = total_pages;
-        pi->free_pages = avail_domheap_pages();
+        /* Protected by lock */
+        get_outstanding_claims(&pi->free_pages, &pi->outstanding_pages);
         pi->scrub_pages = 0;
         pi->cpu_khz = cpu_khz;
         arch_do_physinfo(pi);
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 51d5254..7a26dee 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -459,13 +459,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
  * The zero value is appropiate.
  */
 
-/*
- * Get the number of pages currently claimed (but not yet "possessed")
- * across all domains.  The caller must be privileged but otherwise
- * the call never fails.
- */
-#define XENMEM_get_outstanding_pages        25
-
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 03710d8..8437d31 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -34,7 +34,7 @@
 #include "xen.h"
 #include "domctl.h"
 
-#define XEN_SYSCTL_INTERFACE_VERSION 0x00000009
+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000A
 
 /*
  * Read console content from Xen buffer ring.
@@ -101,6 +101,7 @@ struct xen_sysctl_physinfo {
     uint64_aligned_t total_pages;
     uint64_aligned_t free_pages;
     uint64_aligned_t scrub_pages;
+    uint64_aligned_t outstanding_pages;
     uint32_t hw_cap[8];
 
     /* XEN_SYSCTL_PHYSCAP_??? */
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index efc45c7..4f5795c 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -59,7 +59,7 @@ void destroy_xen_mappings(unsigned long v, unsigned long e);
 /* Claim handling */
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
 int domain_set_outstanding_pages(struct domain *d, unsigned long pages);
-long get_outstanding_claims(void);
+void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages);
 
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index a872056..cc0a5a8 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -259,12 +259,6 @@ static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_xenmem_get_outstanding_pages(XSM_DEFAULT_VOID)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, NULL);
-}
-
 static XSM_INLINE int xsm_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn,
                                          domid_t id2)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 58a4fbb..1939453 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -93,7 +93,6 @@ struct xsm_operations {
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
     int (*claim_pages) (struct domain *d);
-    int (*xenmem_get_outstanding_pages) (void);
 
     int (*console_io) (struct domain *d, int cmd);
 
@@ -360,11 +359,6 @@ static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
     return xsm_ops->claim_pages(d);
 }
 
-static inline int xsm_xenmem_get_outstanding_pages(xsm_default_t def)
-{
-    return xsm_ops->xenmem_get_outstanding_pages();
-}
-
 static inline int xsm_console_io (xsm_default_t def, struct domain *d, int cmd)
 {
     return xsm_ops->console_io(d, cmd);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 937761f..31e4f73 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -67,7 +67,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, memory_stat_reservation);
     set_to_dummy_if_null(ops, memory_pin_page);
     set_to_dummy_if_null(ops, claim_pages);
-    set_to_dummy_if_null(ops, xenmem_get_outstanding_pages);
 
     set_to_dummy_if_null(ops, console_io);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index bb10de3..fa0589a 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -422,12 +422,6 @@ static int flask_claim_pages(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SETCLAIM);
 }
 
-static int flask_xenmem_get_outstanding_pages(void)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN,
-                                XEN__HEAP, NULL);
-}
-
 static int flask_console_io(struct domain *d, int cmd)
 {
     u32 perm;
@@ -1504,7 +1498,6 @@ static struct xsm_operations flask_ops = {
     .memory_stat_reservation = flask_memory_stat_reservation,
     .memory_pin_page = flask_memory_pin_page,
     .claim_pages = flask_claim_pages,
-    .xenmem_get_outstanding_pages = flask_xenmem_get_outstanding_pages,
 
     .console_io = flask_console_io,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 544c3ba..5dfe13b 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -54,7 +54,7 @@ class xen
     debug
 # XEN_SYSCTL_getcpuinfo, XENPF_get_cpu_version, XENPF_get_cpuinfo
     getcpuinfo
-# XEN_SYSCTL_availheap, XENMEM_get_outstanding_pages
+# XEN_SYSCTL_availheap
     heap
 # XEN_SYSCTL_get_pmstat, XEN_SYSCTL_pm_op, XENPF_set_processor_pminfo,
 # XENPF_core_parking
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16: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 1UcIAH-00082z-1i; Tue, 14 May 2013 16:33: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 1UcIAF-00082o-Uy
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:24 +0000
Received: from [85.158.138.51:45886] by server-12.bemta-3.messagelabs.com id
	77/56-17342-E4762915; Tue, 14 May 2013 16:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1368549194!32627100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14741 invoked from network); 14 May 2013 16:33:16 -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;
	14 May 2013 16:33: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 1UcIA6-000473-C2
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIA6-0008UM-2F
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:14 +0000
Date: Tue, 14 May 2013 16:33:14 +0000
Message-Id: <E1UcIA6-0008UM-2F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Change claim_mode from bool to
	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 93b241e9d2c23b75f400a9ccda40838b9d13e27d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:12 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:02:00 2013 +0100

    libxl: Change claim_mode from bool to int.
    
    During the review it was noticed that it would be better if internally
    the claim_mode was held as an 'int' instead of a 'bool'. The reason
    is that during the startup of xl, one has call the libxl_defbool_setdefault.
    otherwise any usage of claim_mode would result in assert break.
    
    The assert is due to the fact that using defbool without any set
    values (either true of false) will cause it hit an assertion.
    
    If we use an 'int' we don't have to worry about it and by default
    the value of zero will suffice for checks whether the claim is
    enabled or disabled.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/xl.c         |    6 +++---
 tools/libxl/xl.h         |    2 +-
 tools/libxl/xl_cmdimpl.c |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 3c141bf..1ce820c 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -46,7 +46,7 @@ char *default_vifscript = NULL;
 char *default_bridge = NULL;
 char *default_gatewaydev = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
-libxl_defbool claim_mode;
+int claim_mode = 0;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
 
@@ -170,8 +170,8 @@ static void parse_global_config(const char *configfile,
     if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
         blkdev_start = strdup(buf);
 
-    libxl_defbool_setdefault(&claim_mode, false);
-    (void)xlu_cfg_get_defbool (config, "claim_mode", &claim_mode, 0);
+    if (!xlu_cfg_get_long (config, "claim_mode", &l, 0))
+        claim_mode = l;
 
     xlu_cfg_destroy(config);
 }
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 771b4af..5ad3e17 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -146,7 +146,7 @@ int xl_child_pid(xlchildnum); /* returns 0 if child struct is not in use */
 extern int autoballoon;
 extern int run_hotplug_scripts;
 extern int dryrun_only;
-extern libxl_defbool claim_mode;
+extern int claim_mode;
 extern char *lockfile;
 extern char *default_vifscript;
 extern char *default_bridge;
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index edf0325..609ce49 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -734,7 +734,7 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long (config, "maxmem", &l, 0))
         b_info->max_memkb = l * 1024;
 
-    b_info->claim_mode = claim_mode;
+    libxl_defbool_set(&b_info->claim_mode, claim_mode);
 
     if (xlu_cfg_get_string (config, "on_poweroff", &buf, 0))
         buf = "destroy";
@@ -4607,7 +4607,7 @@ static void output_physinfo(void)
     /*
      * Only if enabled (claim_mode=1) or there are outstanding claims.
      */
-    if (libxl_defbool_val(claim_mode) || info.outstanding_pages)
+    if (claim_mode || info.outstanding_pages)
         printf("outstanding_claims     : %"PRIu64"\n", info.outstanding_pages / i);
 
     if (!libxl_get_freecpus(ctx, &cpumap)) {
@@ -5911,7 +5911,7 @@ int main_claims(int argc, char **argv)
         /* No options */
     }
 
-    if (!libxl_defbool_val(claim_mode))
+    if (!claim_mode)
         fprintf(stderr, "claim_mode not enabled (see man xl.conf).\n");
 
     info = libxl_list_domain(ctx, &nb_domain);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16: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 1UcIAH-00082z-1i; Tue, 14 May 2013 16:33: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 1UcIAF-00082o-Uy
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:24 +0000
Received: from [85.158.138.51:45886] by server-12.bemta-3.messagelabs.com id
	77/56-17342-E4762915; Tue, 14 May 2013 16:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1368549194!32627100!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14741 invoked from network); 14 May 2013 16:33:16 -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;
	14 May 2013 16:33: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 1UcIA6-000473-C2
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIA6-0008UM-2F
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:14 +0000
Date: Tue, 14 May 2013 16:33:14 +0000
Message-Id: <E1UcIA6-0008UM-2F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Change claim_mode from bool to
	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 93b241e9d2c23b75f400a9ccda40838b9d13e27d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:12 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:02:00 2013 +0100

    libxl: Change claim_mode from bool to int.
    
    During the review it was noticed that it would be better if internally
    the claim_mode was held as an 'int' instead of a 'bool'. The reason
    is that during the startup of xl, one has call the libxl_defbool_setdefault.
    otherwise any usage of claim_mode would result in assert break.
    
    The assert is due to the fact that using defbool without any set
    values (either true of false) will cause it hit an assertion.
    
    If we use an 'int' we don't have to worry about it and by default
    the value of zero will suffice for checks whether the claim is
    enabled or disabled.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/xl.c         |    6 +++---
 tools/libxl/xl.h         |    2 +-
 tools/libxl/xl_cmdimpl.c |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 3c141bf..1ce820c 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -46,7 +46,7 @@ char *default_vifscript = NULL;
 char *default_bridge = NULL;
 char *default_gatewaydev = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
-libxl_defbool claim_mode;
+int claim_mode = 0;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
 
@@ -170,8 +170,8 @@ static void parse_global_config(const char *configfile,
     if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
         blkdev_start = strdup(buf);
 
-    libxl_defbool_setdefault(&claim_mode, false);
-    (void)xlu_cfg_get_defbool (config, "claim_mode", &claim_mode, 0);
+    if (!xlu_cfg_get_long (config, "claim_mode", &l, 0))
+        claim_mode = l;
 
     xlu_cfg_destroy(config);
 }
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 771b4af..5ad3e17 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -146,7 +146,7 @@ int xl_child_pid(xlchildnum); /* returns 0 if child struct is not in use */
 extern int autoballoon;
 extern int run_hotplug_scripts;
 extern int dryrun_only;
-extern libxl_defbool claim_mode;
+extern int claim_mode;
 extern char *lockfile;
 extern char *default_vifscript;
 extern char *default_bridge;
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index edf0325..609ce49 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -734,7 +734,7 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long (config, "maxmem", &l, 0))
         b_info->max_memkb = l * 1024;
 
-    b_info->claim_mode = claim_mode;
+    libxl_defbool_set(&b_info->claim_mode, claim_mode);
 
     if (xlu_cfg_get_string (config, "on_poweroff", &buf, 0))
         buf = "destroy";
@@ -4607,7 +4607,7 @@ static void output_physinfo(void)
     /*
      * Only if enabled (claim_mode=1) or there are outstanding claims.
      */
-    if (libxl_defbool_val(claim_mode) || info.outstanding_pages)
+    if (claim_mode || info.outstanding_pages)
         printf("outstanding_claims     : %"PRIu64"\n", info.outstanding_pages / i);
 
     if (!libxl_get_freecpus(ctx, &cpumap)) {
@@ -5911,7 +5911,7 @@ int main_claims(int argc, char **argv)
         /* No options */
     }
 
-    if (!libxl_defbool_val(claim_mode))
+    if (!claim_mode)
         fprintf(stderr, "claim_mode not enabled (see man xl.conf).\n");
 
     info = libxl_list_domain(ctx, &nb_domain);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:33: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 1UcIAV-00084w-4l; Tue, 14 May 2013 16:33:39 +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 1UcIAT-00084d-J4
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:37 +0000
Received: from [85.158.143.99:34449] by server-1.bemta-4.messagelabs.com id
	00/E7-06122-06762915; Tue, 14 May 2013 16:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1368549215!23236588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5648 invoked from network); 14 May 2013 16:33:36 -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;
	14 May 2013 16:33: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 1UcIAR-00047C-1Q
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAQ-0008V8-W0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:35 +0000
Date: Tue, 14 May 2013 16:33:34 +0000
Message-Id: <E1UcIAQ-0008V8-W0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Make 'xl vcpu-set' work
	properly on overcommited hosts with an override.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 afab6f6788b3e1eeed7fd7d2550bca96edca2720
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:14 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:02:13 2013 +0100

    libxl: Make 'xl vcpu-set' work properly on overcommited hosts with an override.
    
    The libxl_cpu_bitmap_alloc(..) function, if provided with a zero
    value for max CPUs will call xc_get_max_cpus() which will retrieve
    the number of physical CPUs the host has. This is usually
    OK if the guest's maxvcpus <= host pcpus. But if the value
    is different, then the bitmap for VCPUs is limited by the
    number of CPUs the host has.
    
    This is incorrect as what we want is to hotplug in the guest
    the amount of CPUs that the user specified on the command line
    and not be limited by the amount of physical CPUs.
    
    This means that a guest config like this:
    
    vcpus=8
    maxvcpus=32
    
    and on a 4 PCPU machine doing
    
    xl vcpu-set <guest name> 16
    
    won't work. This is b/c the the size of the bitmap is one byte
    so it can only hold up to 8 VCPUs. Hence anything above that
    is going to be ignored.
    
    Note that this patch also fixes the bitmap setting - as it
    would set all of the bits allowed. Meaning if the user had a 4PCPU
    host we would still allow the user to set 8VCPUs. This second
    iteration of the patch fixes this.
    
    Note that all of the libxl_cpu_bitmap_[test|set] silently ignore
    any test or sets above its size:
    
         if (bit >= bitmap->size * 8)
             return 0;
    
    so we were never notified off this bug.
    
    This patch warns the user if they are trying to do this. If the
    user really wants to do this they have to provide the --ignore-host
    parameter to bypass this check.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c  |   35 +++++++++++++++++++++++++++++------
 tools/libxl/xl_cmdtable.c |    3 ++-
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 497d84d..e13a64e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4487,7 +4487,7 @@ int main_vcpupin(int argc, char **argv)
     return 0;
 }
 
-static void vcpuset(uint32_t domid, const char* nr_vcpus)
+static void vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
 {
     char *endptr;
     unsigned int max_vcpus, i;
@@ -4499,7 +4499,22 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)
         return;
     }
 
-    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
+    /*
+     * Maximum amount of vCPUS the guest is allowed to set is limited
+     * by the host's amount of pCPUs.
+     */
+    if (check_host) {
+        unsigned int host_cpu = libxl_get_max_cpus(ctx);
+        if (max_vcpus > host_cpu) {
+            fprintf(stderr, "You are overcommmitting! You have %d physical " \
+                    " CPUs and want %d vCPUs! Aborting, use --ignore-host to " \
+                    " continue\n", host_cpu, max_vcpus);
+            return;
+        }
+        /* NB: This also limits how many are set in the bitmap */
+        max_vcpus = (max_vcpus > host_cpu ? host_cpu : max_vcpus);
+    }
+    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed\n");
         return;
     }
@@ -4514,13 +4529,21 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)
 
 int main_vcpuset(int argc, char **argv)
 {
-    int opt;
+    static struct option opts[] = {
+        {"ignore-host", 0, 0, 'i'},
+        {0, 0, 0, 0}
+    };
+    int opt, check_host = 1;
 
-    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-set", 2) {
-        /* No options */
+    SWITCH_FOREACH_OPT(opt, "i", opts, "vcpu-set", 2) {
+    case 'i':
+        check_host = 0;
+        break;
+    default:
+        break;
     }
 
-    vcpuset(find_domain(argv[optind]), argv[optind+1]);
+    vcpuset(find_domain(argv[optind]), argv[optind + 1], check_host);
     return 0;
 }
 
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 26f5025..44b42b0 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -217,7 +217,8 @@ struct cmd_spec cmd_table[] = {
     { "vcpu-set",
       &main_vcpuset, 0, 1,
       "Set the number of active VCPUs allowed for the domain",
-      "<Domain> <vCPUs>",
+      "[option] <Domain> <vCPUs>",
+      "-i, --ignore-host  Don't limit the vCPU based on the host CPU count",
     },
     { "vm-list",
       &main_vm_list, 0, 0,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:33: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 1UcIAV-00084w-4l; Tue, 14 May 2013 16:33:39 +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 1UcIAT-00084d-J4
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:37 +0000
Received: from [85.158.143.99:34449] by server-1.bemta-4.messagelabs.com id
	00/E7-06122-06762915; Tue, 14 May 2013 16:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1368549215!23236588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5648 invoked from network); 14 May 2013 16:33:36 -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;
	14 May 2013 16:33: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 1UcIAR-00047C-1Q
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAQ-0008V8-W0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:35 +0000
Date: Tue, 14 May 2013 16:33:34 +0000
Message-Id: <E1UcIAQ-0008V8-W0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Make 'xl vcpu-set' work
	properly on overcommited hosts with an override.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 afab6f6788b3e1eeed7fd7d2550bca96edca2720
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:14 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:02:13 2013 +0100

    libxl: Make 'xl vcpu-set' work properly on overcommited hosts with an override.
    
    The libxl_cpu_bitmap_alloc(..) function, if provided with a zero
    value for max CPUs will call xc_get_max_cpus() which will retrieve
    the number of physical CPUs the host has. This is usually
    OK if the guest's maxvcpus <= host pcpus. But if the value
    is different, then the bitmap for VCPUs is limited by the
    number of CPUs the host has.
    
    This is incorrect as what we want is to hotplug in the guest
    the amount of CPUs that the user specified on the command line
    and not be limited by the amount of physical CPUs.
    
    This means that a guest config like this:
    
    vcpus=8
    maxvcpus=32
    
    and on a 4 PCPU machine doing
    
    xl vcpu-set <guest name> 16
    
    won't work. This is b/c the the size of the bitmap is one byte
    so it can only hold up to 8 VCPUs. Hence anything above that
    is going to be ignored.
    
    Note that this patch also fixes the bitmap setting - as it
    would set all of the bits allowed. Meaning if the user had a 4PCPU
    host we would still allow the user to set 8VCPUs. This second
    iteration of the patch fixes this.
    
    Note that all of the libxl_cpu_bitmap_[test|set] silently ignore
    any test or sets above its size:
    
         if (bit >= bitmap->size * 8)
             return 0;
    
    so we were never notified off this bug.
    
    This patch warns the user if they are trying to do this. If the
    user really wants to do this they have to provide the --ignore-host
    parameter to bypass this check.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c  |   35 +++++++++++++++++++++++++++++------
 tools/libxl/xl_cmdtable.c |    3 ++-
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 497d84d..e13a64e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4487,7 +4487,7 @@ int main_vcpupin(int argc, char **argv)
     return 0;
 }
 
-static void vcpuset(uint32_t domid, const char* nr_vcpus)
+static void vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
 {
     char *endptr;
     unsigned int max_vcpus, i;
@@ -4499,7 +4499,22 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)
         return;
     }
 
-    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
+    /*
+     * Maximum amount of vCPUS the guest is allowed to set is limited
+     * by the host's amount of pCPUs.
+     */
+    if (check_host) {
+        unsigned int host_cpu = libxl_get_max_cpus(ctx);
+        if (max_vcpus > host_cpu) {
+            fprintf(stderr, "You are overcommmitting! You have %d physical " \
+                    " CPUs and want %d vCPUs! Aborting, use --ignore-host to " \
+                    " continue\n", host_cpu, max_vcpus);
+            return;
+        }
+        /* NB: This also limits how many are set in the bitmap */
+        max_vcpus = (max_vcpus > host_cpu ? host_cpu : max_vcpus);
+    }
+    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed\n");
         return;
     }
@@ -4514,13 +4529,21 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)
 
 int main_vcpuset(int argc, char **argv)
 {
-    int opt;
+    static struct option opts[] = {
+        {"ignore-host", 0, 0, 'i'},
+        {0, 0, 0, 0}
+    };
+    int opt, check_host = 1;
 
-    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-set", 2) {
-        /* No options */
+    SWITCH_FOREACH_OPT(opt, "i", opts, "vcpu-set", 2) {
+    case 'i':
+        check_host = 0;
+        break;
+    default:
+        break;
     }
 
-    vcpuset(find_domain(argv[optind]), argv[optind+1]);
+    vcpuset(find_domain(argv[optind]), argv[optind + 1], check_host);
     return 0;
 }
 
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 26f5025..44b42b0 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -217,7 +217,8 @@ struct cmd_spec cmd_table[] = {
     { "vcpu-set",
       &main_vcpuset, 0, 1,
       "Set the number of active VCPUs allowed for the domain",
-      "<Domain> <vCPUs>",
+      "[option] <Domain> <vCPUs>",
+      "-i, --ignore-host  Don't limit the vCPU based on the host CPU count",
     },
     { "vm-list",
       &main_vm_list, 0, 0,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:57 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:33: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 1UcIAl-00087G-8L; Tue, 14 May 2013 16:33:55 +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 1UcIAj-000871-Kl
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:54 +0000
Received: from [85.158.137.99:28464] by server-8.bemta-3.messagelabs.com id
	DD/26-25864-B6762915; Tue, 14 May 2013 16:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1368549225!16713927!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3937 invoked from network); 14 May 2013 16:33:46 -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;
	14 May 2013 16:33: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 1UcIAb-00047I-69
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAb-0008Ve-4w
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:45 +0000
Date: Tue, 14 May 2013 16:33:45 +0000
Message-Id: <E1UcIAb-0008Ve-4w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add emacs magic blocks to asm
	files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 aa83790810f6ca75b0a26db3aac3d1b904e909bd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 17:22:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:04:07 2013 +0100

    xen/arm: Add emacs magic blocks to asm files
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/arm32/debug.S       |    7 +++++++
 xen/arch/arm/arm64/debug.S       |    7 +++++++
 xen/arch/arm/arm64/head.S        |    7 +++++++
 xen/arch/arm/arm64/mode_switch.S |    7 +++++++
 4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/arm32/debug.S b/xen/arch/arm/arm32/debug.S
index 09e5cae..1bfbfc1 100644
--- a/xen/arch/arm/arm32/debug.S
+++ b/xen/arch/arm/arm32/debug.S
@@ -31,3 +31,10 @@ early_putch:
         early_uart_ready r1, r2
         early_uart_transmit r1, r0
         mov   pc, lr
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
index 48a6567..f0c7761 100644
--- a/xen/arch/arm/arm64/debug.S
+++ b/xen/arch/arm/arm64/debug.S
@@ -31,3 +31,10 @@ early_putch:
         early_uart_ready x23, 1
         early_uart_transmit x23, w0
         ret
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 79a8da9..8955946 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -384,3 +384,10 @@ puts:
 putn:   ret
 
 #endif /* EARLY_PRINTK */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/mode_switch.S b/xen/arch/arm/arm64/mode_switch.S
index d115706..4125ac4 100644
--- a/xen/arch/arm/arm64/mode_switch.S
+++ b/xen/arch/arm/arm64/mode_switch.S
@@ -82,3 +82,10 @@ enter_el2_mode:
         mov     x1, #0x3c9                      // EL2_SP1 | D | A | I | F
         msr     spsr_el3, x1
         eret
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:33:57 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:33: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 1UcIAl-00087G-8L; Tue, 14 May 2013 16:33:55 +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 1UcIAj-000871-Kl
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:54 +0000
Received: from [85.158.137.99:28464] by server-8.bemta-3.messagelabs.com id
	DD/26-25864-B6762915; Tue, 14 May 2013 16:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1368549225!16713927!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3937 invoked from network); 14 May 2013 16:33:46 -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;
	14 May 2013 16:33: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 1UcIAb-00047I-69
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAb-0008Ve-4w
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:45 +0000
Date: Tue, 14 May 2013 16:33:45 +0000
Message-Id: <E1UcIAb-0008Ve-4w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add emacs magic blocks to asm
	files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 aa83790810f6ca75b0a26db3aac3d1b904e909bd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 17:22:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:04:07 2013 +0100

    xen/arm: Add emacs magic blocks to asm files
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/arm32/debug.S       |    7 +++++++
 xen/arch/arm/arm64/debug.S       |    7 +++++++
 xen/arch/arm/arm64/head.S        |    7 +++++++
 xen/arch/arm/arm64/mode_switch.S |    7 +++++++
 4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/arm32/debug.S b/xen/arch/arm/arm32/debug.S
index 09e5cae..1bfbfc1 100644
--- a/xen/arch/arm/arm32/debug.S
+++ b/xen/arch/arm/arm32/debug.S
@@ -31,3 +31,10 @@ early_putch:
         early_uart_ready r1, r2
         early_uart_transmit r1, r0
         mov   pc, lr
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
index 48a6567..f0c7761 100644
--- a/xen/arch/arm/arm64/debug.S
+++ b/xen/arch/arm/arm64/debug.S
@@ -31,3 +31,10 @@ early_putch:
         early_uart_ready x23, 1
         early_uart_transmit x23, w0
         ret
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 79a8da9..8955946 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -384,3 +384,10 @@ puts:
 putn:   ret
 
 #endif /* EARLY_PRINTK */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/mode_switch.S b/xen/arch/arm/arm64/mode_switch.S
index d115706..4125ac4 100644
--- a/xen/arch/arm/arm64/mode_switch.S
+++ b/xen/arch/arm/arm64/mode_switch.S
@@ -82,3 +82,10 @@ enter_el2_mode:
         mov     x1, #0x3c9                      // EL2_SP1 | D | A | I | F
         msr     spsr_el3, x1
         eret
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:34:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:34: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 1UcIAp-00088T-DQ; Tue, 14 May 2013 16:33:59 +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 1UcIAn-00087m-Po
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:57 +0000
Received: from [85.158.143.99:32442] by server-1.bemta-4.messagelabs.com id
	15/18-06122-57762915; Tue, 14 May 2013 16:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1368549235!29482874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18618 invoked from network); 14 May 2013 16:33:56 -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;
	14 May 2013 16:33: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 1UcIAl-00047R-E4
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAl-0008W3-BZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:55 +0000
Date: Tue, 14 May 2013 16:33:55 +0000
Message-Id: <E1UcIAl-0008W3-BZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: do not clobber callee saved
	register in early_putch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2629838162255cc1207a80f8976fbd4e51763a76
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 17:23:00 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:04:14 2013 +0100

    xen/arm64: do not clobber callee saved register in early_putch
    
    x23 is callee saved in the ARM 64 bit calling convention. Use x15 instead
    which is a temporary register which need not be preserved.
    
    Fixes a random crash during boot.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm64/debug.S |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
index f0c7761..38b7c74 100644
--- a/xen/arch/arm/arm64/debug.S
+++ b/xen/arch/arm/arm64/debug.S
@@ -27,9 +27,9 @@
 /* Print a character on the UART - this function is called by C
  * x0: character to print */
 early_putch:
-        ldr   x23, =FIXMAP_ADDR(FIXMAP_CONSOLE)
-        early_uart_ready x23, 1
-        early_uart_transmit x23, w0
+        ldr   x15, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+        early_uart_ready x15, 1
+        early_uart_transmit x15, w0
         ret
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:34:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:34: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 1UcIAp-00088T-DQ; Tue, 14 May 2013 16:33:59 +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 1UcIAn-00087m-Po
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:57 +0000
Received: from [85.158.143.99:32442] by server-1.bemta-4.messagelabs.com id
	15/18-06122-57762915; Tue, 14 May 2013 16:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1368549235!29482874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18618 invoked from network); 14 May 2013 16:33:56 -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;
	14 May 2013 16:33: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 1UcIAl-00047R-E4
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAl-0008W3-BZ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:55 +0000
Date: Tue, 14 May 2013 16:33:55 +0000
Message-Id: <E1UcIAl-0008W3-BZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: do not clobber callee saved
	register in early_putch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2629838162255cc1207a80f8976fbd4e51763a76
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 17:23:00 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:04:14 2013 +0100

    xen/arm64: do not clobber callee saved register in early_putch
    
    x23 is callee saved in the ARM 64 bit calling convention. Use x15 instead
    which is a temporary register which need not be preserved.
    
    Fixes a random crash during boot.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm64/debug.S |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
index f0c7761..38b7c74 100644
--- a/xen/arch/arm/arm64/debug.S
+++ b/xen/arch/arm/arm64/debug.S
@@ -27,9 +27,9 @@
 /* Print a character on the UART - this function is called by C
  * x0: character to print */
 early_putch:
-        ldr   x23, =FIXMAP_ADDR(FIXMAP_CONSOLE)
-        early_uart_ready x23, 1
-        early_uart_transmit x23, w0
+        ldr   x15, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+        early_uart_ready x15, 1
+        early_uart_transmit x15, w0
         ret
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:34: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 1UcIB0-0008Ar-Gy; Tue, 14 May 2013 16:34: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 1UcIAz-0008AT-8c
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:09 +0000
Received: from [85.158.139.211:20092] by server-3.bemta-5.messagelabs.com id
	31/63-31108-F7762915; Tue, 14 May 2013 16:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1368549245!23067814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12883 invoked from network); 14 May 2013 16:34:06 -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;
	14 May 2013 16:34: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 1UcIAv-000483-KC
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAv-0008WR-IG
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:05 +0000
Date: Tue, 14 May 2013 16:34:05 +0000
Message-Id: <E1UcIAv-0008WR-IG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support "arm,
	armv8-timer" DTS compatibility.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 56bbdea25d3b333103d5b274a61846b10d1fb261
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 17:23:01 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:04:21 2013 +0100

    xen/arm: support "arm, armv8-timer" DTS compatibility.
    
    On v8 the compatibility name differs but the node is otherwise specified the
    same. See linux/Documentation/devicetree/bindings/arm/arch_timer.txt
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/time.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index db849cf..4ed7882 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -107,6 +107,8 @@ int __init init_xen_time(void)
 
     dev = dt_find_compatible_node(NULL, NULL, "arm,armv7-timer");
     if ( !dev )
+        dev = dt_find_compatible_node(NULL, NULL, "arm,armv8-timer");
+    if ( !dev )
         panic("Unable to find a compatible timer in the device tree\n");
 
     dt_device_set_used_by(dev, DOMID_XEN);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:34: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 1UcIB0-0008Ar-Gy; Tue, 14 May 2013 16:34: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 1UcIAz-0008AT-8c
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:09 +0000
Received: from [85.158.139.211:20092] by server-3.bemta-5.messagelabs.com id
	31/63-31108-F7762915; Tue, 14 May 2013 16:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1368549245!23067814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12883 invoked from network); 14 May 2013 16:34:06 -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;
	14 May 2013 16:34: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 1UcIAv-000483-KC
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAv-0008WR-IG
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:05 +0000
Date: Tue, 14 May 2013 16:34:05 +0000
Message-Id: <E1UcIAv-0008WR-IG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support "arm,
	armv8-timer" DTS compatibility.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 56bbdea25d3b333103d5b274a61846b10d1fb261
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon May 13 17:23:01 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:04:21 2013 +0100

    xen/arm: support "arm, armv8-timer" DTS compatibility.
    
    On v8 the compatibility name differs but the node is otherwise specified the
    same. See linux/Documentation/devicetree/bindings/arm/arch_timer.txt
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/time.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index db849cf..4ed7882 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -107,6 +107,8 @@ int __init init_xen_time(void)
 
     dev = dt_find_compatible_node(NULL, NULL, "arm,armv7-timer");
     if ( !dev )
+        dev = dt_find_compatible_node(NULL, NULL, "arm,armv8-timer");
+    if ( !dev )
         panic("Unable to find a compatible timer in the device tree\n");
 
     dt_device_set_used_by(dev, DOMID_XEN);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:34:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:34: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 1UcIBI-0008ED-Ku; Tue, 14 May 2013 16:34:28 +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 1UcIBG-0008Dq-Um
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:27 +0000
Received: from [85.158.139.211:21736] by server-11.bemta-5.messagelabs.com id
	3E/8E-26693-29762915; Tue, 14 May 2013 16:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1368549264!22638285!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24882 invoked from network); 14 May 2013 16:34:25 -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;
	14 May 2013 16:34: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 1UcIAG-000479-S0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAG-0008Uj-HJ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:24 +0000
Date: Tue, 14 May 2013 16:33:24 +0000
Message-Id: <E1UcIAG-0008Uj-HJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: claim: Print the values in 'xl
	info' unconditionally
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6a0a079a934bb45c070aa86861453a3fdbaa0b85
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:13 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:02:06 2013 +0100

    libxl: claim: Print the values in 'xl info' unconditionally
    
    During the review of "libxl: Change claim_mode from bool to int."
    Ian Campbell suggested that the xl info should print the
    claim information irregardless of the global claim_mode value.
    
    Suggested-by: Ian Campbell <Ian.Campbell@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 609ce49..497d84d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4603,13 +4603,8 @@ static void output_physinfo(void)
         printf("free_memory            : %"PRIu64"\n", (info.free_pages - info.outstanding_pages) / i);
         printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
         printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
-    }
-    /*
-     * Only if enabled (claim_mode=1) or there are outstanding claims.
-     */
-    if (claim_mode || info.outstanding_pages)
         printf("outstanding_claims     : %"PRIu64"\n", info.outstanding_pages / i);
-
+    }
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_bit(i, cpumap)
             if (libxl_bitmap_test(&cpumap, i))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 14 16:34:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 May 2013 16:34: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 1UcIBI-0008ED-Ku; Tue, 14 May 2013 16:34:28 +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 1UcIBG-0008Dq-Um
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:34:27 +0000
Received: from [85.158.139.211:21736] by server-11.bemta-5.messagelabs.com id
	3E/8E-26693-29762915; Tue, 14 May 2013 16:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1368549264!22638285!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24882 invoked from network); 14 May 2013 16:34:25 -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;
	14 May 2013 16:34: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 1UcIAG-000479-S0
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcIAG-0008Uj-HJ
	for xen-changelog@lists.xensource.com; Tue, 14 May 2013 16:33:24 +0000
Date: Tue, 14 May 2013 16:33:24 +0000
Message-Id: <E1UcIAG-0008Uj-HJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: claim: Print the values in 'xl
	info' unconditionally
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6a0a079a934bb45c070aa86861453a3fdbaa0b85
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon May 13 15:29:13 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue May 14 10:02:06 2013 +0100

    libxl: claim: Print the values in 'xl info' unconditionally
    
    During the review of "libxl: Change claim_mode from bool to int."
    Ian Campbell suggested that the xl info should print the
    claim information irregardless of the global claim_mode value.
    
    Suggested-by: Ian Campbell <Ian.Campbell@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 609ce49..497d84d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4603,13 +4603,8 @@ static void output_physinfo(void)
         printf("free_memory            : %"PRIu64"\n", (info.free_pages - info.outstanding_pages) / i);
         printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
         printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
-    }
-    /*
-     * Only if enabled (claim_mode=1) or there are outstanding claims.
-     */
-    if (claim_mode || info.outstanding_pages)
         printf("outstanding_claims     : %"PRIu64"\n", info.outstanding_pages / i);
-
+    }
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_bit(i, cpumap)
             if (libxl_bitmap_test(&cpumap, i))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 15 17:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 May 2013 17:33: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 1UcfZc-0005Mq-9H; Wed, 15 May 2013 17:33: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 1UcfZb-0005Ml-HN
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:07 +0000
Received: from [85.158.143.99:58985] by server-2.bemta-4.messagelabs.com id
	FB/FE-27124-2D6C3915; Wed, 15 May 2013 17:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1368639185!32529129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24479 invoked from network); 15 May 2013 17:33:06 -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;
	15 May 2013 17:33: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 1UcfZZ-00019U-23
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcfZX-000242-2x
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:03 +0000
Date: Wed, 15 May 2013 17:33:03 +0000
Message-Id: <E1UcfZX-000242-2x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xen Machine Check (MCA) & RAS
	Maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 256235f7e2df30a9cff300e067681a2aacfe9e4d
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Wed May 15 10:48:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 10:48:26 2013 +0200

    Xen Machine Check (MCA) & RAS Maintainer
    
    Co-maintain Xen Machine Check (MCA) & RAS
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    Acked-by: Yunhong Jiang <yunhong.jiang@intel.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index b1e8d23..cc8ca2e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -204,7 +204,7 @@ T:	hg http://xenbits.xen.org/XCP/linux-2.6.*.pq.hg
 
 MACHINE CHECK (MCA) & RAS
 M:	Christoph Egger <chegger@amazon.de>
-M:	Yunhong Jiang <yunhong.jiang@intel.com>
+M:	Liu Jinsong <jinsong.liu@intel.com>
 S:	Supported
 F:	xen/arch/x86/cpu/mcheck/
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 15 17:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 May 2013 17:33: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 1UcfZc-0005Mq-9H; Wed, 15 May 2013 17:33: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 1UcfZb-0005Ml-HN
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:07 +0000
Received: from [85.158.143.99:58985] by server-2.bemta-4.messagelabs.com id
	FB/FE-27124-2D6C3915; Wed, 15 May 2013 17:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1368639185!32529129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24479 invoked from network); 15 May 2013 17:33:06 -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;
	15 May 2013 17:33: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 1UcfZZ-00019U-23
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcfZX-000242-2x
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:03 +0000
Date: Wed, 15 May 2013 17:33:03 +0000
Message-Id: <E1UcfZX-000242-2x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xen Machine Check (MCA) & RAS
	Maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 256235f7e2df30a9cff300e067681a2aacfe9e4d
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Wed May 15 10:48:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 10:48:26 2013 +0200

    Xen Machine Check (MCA) & RAS Maintainer
    
    Co-maintain Xen Machine Check (MCA) & RAS
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    Acked-by: Yunhong Jiang <yunhong.jiang@intel.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index b1e8d23..cc8ca2e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -204,7 +204,7 @@ T:	hg http://xenbits.xen.org/XCP/linux-2.6.*.pq.hg
 
 MACHINE CHECK (MCA) & RAS
 M:	Christoph Egger <chegger@amazon.de>
-M:	Yunhong Jiang <yunhong.jiang@intel.com>
+M:	Liu Jinsong <jinsong.liu@intel.com>
 S:	Supported
 F:	xen/arch/x86/cpu/mcheck/
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 15 17:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 May 2013 17: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 1UcfZq-0005Nc-Ck; Wed, 15 May 2013 17:33: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 1UcfZp-0005NV-TB
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:22 +0000
Received: from [85.158.143.99:50119] by server-2.bemta-4.messagelabs.com id
	29/1F-27124-1E6C3915; Wed, 15 May 2013 17:33:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1368639196!27772416!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2456 invoked from network); 15 May 2013 17:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	15 May 2013 17:33: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 1UcfZk-00019X-AG
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcfZj-00024Z-6q
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:15 +0000
Date: Wed, 15 May 2013 17:33:15 +0000
Message-Id: <E1UcfZj-00024Z-6q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xen Power Management Maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 00dece7696c868de6ecb662da067adce814c41d2
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Wed May 15 10:51:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 10:51:20 2013 +0200

    Xen Power Management Maintainer
    
    Separate Xen ACPI and Xen Power Management, co-maintain Xen Power Management.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: "Wang, Winston L" <winston.l.wang@intel.com>
    Acked-by: "Wei, Gang" <gang.wei@intel.com>
    
    Make the affected file lists a little more precise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index cc8ca2e..843f9e3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -97,14 +97,12 @@ Maintainers List (try to look for most precise areas first)
 
 		-----------------------------------
 
-ACPI & POWER MANAGEMENT
-M:	Winston Wang <winston.l.wang@intel.com>
-M:	Gang Wei <gang.wei@intel.com>
+ACPI
 M:	Jan Beulich <jbeulich@suse.com>
 S:	Supported
 F:	xen/arch/x86/acpi/
 F:	xen/drivers/acpi/
-F:	xen/drivers/cpufreq/
+F:	xen/include/acpi/
 
 AMD IOMMU
 M:	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
@@ -219,6 +217,16 @@ M:	David Scott <dave.scott@eu.citrix.com>
 S:	Supported
 F:	tools/ocaml/
 
+POWER MANAGEMENT
+M:	Jan Beulich <jbeulich@suse.com>
+M:	Liu Jinsong <jinsong.liu@intel.com>
+S:	Supported
+F:	xen/arch/x86/acpi/
+X:	xen/arch/x86/acpi/boot.c
+X:	xen/arch/x86/acpi/lib.c
+F:	xen/drivers/cpufreq/
+F:	xen/include/acpi/cpufreq/
+
 QEMU-DM
 M:	Ian Jackson <ian.jackson@eu.citrix.com>
 S:	Supported
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 15 17:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 May 2013 17: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 1UcfZq-0005Nc-Ck; Wed, 15 May 2013 17:33: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 1UcfZp-0005NV-TB
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:22 +0000
Received: from [85.158.143.99:50119] by server-2.bemta-4.messagelabs.com id
	29/1F-27124-1E6C3915; Wed, 15 May 2013 17:33:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1368639196!27772416!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2456 invoked from network); 15 May 2013 17:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	15 May 2013 17:33: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 1UcfZk-00019X-AG
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcfZj-00024Z-6q
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:15 +0000
Date: Wed, 15 May 2013 17:33:15 +0000
Message-Id: <E1UcfZj-00024Z-6q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xen Power Management Maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 00dece7696c868de6ecb662da067adce814c41d2
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Wed May 15 10:51:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 10:51:20 2013 +0200

    Xen Power Management Maintainer
    
    Separate Xen ACPI and Xen Power Management, co-maintain Xen Power Management.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: "Wang, Winston L" <winston.l.wang@intel.com>
    Acked-by: "Wei, Gang" <gang.wei@intel.com>
    
    Make the affected file lists a little more precise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index cc8ca2e..843f9e3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -97,14 +97,12 @@ Maintainers List (try to look for most precise areas first)
 
 		-----------------------------------
 
-ACPI & POWER MANAGEMENT
-M:	Winston Wang <winston.l.wang@intel.com>
-M:	Gang Wei <gang.wei@intel.com>
+ACPI
 M:	Jan Beulich <jbeulich@suse.com>
 S:	Supported
 F:	xen/arch/x86/acpi/
 F:	xen/drivers/acpi/
-F:	xen/drivers/cpufreq/
+F:	xen/include/acpi/
 
 AMD IOMMU
 M:	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
@@ -219,6 +217,16 @@ M:	David Scott <dave.scott@eu.citrix.com>
 S:	Supported
 F:	tools/ocaml/
 
+POWER MANAGEMENT
+M:	Jan Beulich <jbeulich@suse.com>
+M:	Liu Jinsong <jinsong.liu@intel.com>
+S:	Supported
+F:	xen/arch/x86/acpi/
+X:	xen/arch/x86/acpi/boot.c
+X:	xen/arch/x86/acpi/lib.c
+F:	xen/drivers/cpufreq/
+F:	xen/include/acpi/cpufreq/
+
 QEMU-DM
 M:	Ian Jackson <ian.jackson@eu.citrix.com>
 S:	Supported
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 15 17:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 May 2013 17: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 1UcfZz-0005OX-G0; Wed, 15 May 2013 17:33:31 +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 1UcfZy-0005OF-3g
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:30 +0000
Received: from [85.158.143.99:59846] by server-2.bemta-4.messagelabs.com id
	D7/2F-27124-8E6C3915; Wed, 15 May 2013 17:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368639206!28458465!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8484 invoked from network); 15 May 2013 17:33:27 -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;
	15 May 2013 17:33: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 1UcfZu-00019g-IB
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcfZu-00024v-Fm
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:26 +0000
Date: Wed, 15 May 2013 17:33:26 +0000
Message-Id: <E1UcfZu-00024v-Fm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix guest RTE write
	corner cases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 30256a0ff17f6f3b1278b85103187341d5b0ac42
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 15 10:52:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 10:52:02 2013 +0200

    x86/IO-APIC: fix guest RTE write corner cases
    
    This fixes two regressions from c/s 20143:a7de5bd776ca ("x86: Make the
    hypercall PHYSDEVOP_alloc_irq_vector hypercall dummy"):
    
    For one, IRQs that had their vector set up by Xen internally without a
    handler ever having got set (e.g. via "com<n>=..." without a matching
    consumer option like "console=com<n>") would wrongly call
    add_pin_to_irq() here, triggering the BUG_ON() in that function.
    
    Second, when assign_irq_vector() fails this addition to irq_2_pin[]
    needs to be undone.
    
    In the context of this I'm also surprised that the irq_2_pin[]
    manipulations here occur without any lock, i.e. rely on Dom0 to do
    some sort of serialization.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/io_apic.c |   57 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 66c532a..048c61c 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -133,6 +133,37 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin)
     share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
+static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
+{
+    struct irq_pin_list *entry, *prev;
+
+    for (entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next]) {
+        if ((entry->apic == apic) && (entry->pin == pin))
+            break;
+        BUG_ON(!entry->next);
+    }
+
+    entry->pin = entry->apic = -1;
+
+    if (entry != &irq_2_pin[irq]) {
+        /* Removed entry is not at head of list. */
+        prev = &irq_2_pin[irq];
+        while (&irq_2_pin[prev->next] != entry)
+            prev = &irq_2_pin[prev->next];
+        prev->next = entry->next;
+    } else if (entry->next) {
+        /* Removed entry is at head of multi-item list. */
+        prev  = entry;
+        entry = &irq_2_pin[entry->next];
+        *prev = *entry;
+        entry->pin = entry->apic = -1;
+    } else
+        return;
+
+    entry->next = irq_2_pin_free_entry;
+    irq_2_pin_free_entry = entry - irq_2_pin;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -2280,7 +2311,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
-    int apic, pin, irq, ret, vector, pirq;
+    int apic, pin, irq, ret, pirq;
     struct IO_APIC_route_entry rte = { 0 };
     unsigned long flags;
     struct irq_desc *desc;
@@ -2348,13 +2379,25 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         return 0;
     }
 
-    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ) {
-        add_pin_to_irq(irq, apic, pin);
-        vector = assign_irq_vector(irq, NULL);
-        if ( vector < 0 )
-            return vector;
+    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR )
+    {
+        int vector = desc->arch.vector;
+
+        if ( vector < FIRST_HIPRIORITY_VECTOR )
+            add_pin_to_irq(irq, apic, pin);
+        else
+            desc->arch.vector = IRQ_VECTOR_UNASSIGNED;
+        ret = assign_irq_vector(irq, NULL);
+        if ( ret < 0 )
+        {
+            if ( vector < FIRST_HIPRIORITY_VECTOR )
+                remove_pin_from_irq(irq, apic, pin);
+            else
+                desc->arch.vector = vector;
+            return ret;
+        }
 
-        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
     spin_lock(&dom0->event_lock);
     ret = map_domain_pirq(dom0, pirq, irq,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 15 17:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 May 2013 17: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 1UcfZz-0005OX-G0; Wed, 15 May 2013 17:33:31 +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 1UcfZy-0005OF-3g
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:30 +0000
Received: from [85.158.143.99:59846] by server-2.bemta-4.messagelabs.com id
	D7/2F-27124-8E6C3915; Wed, 15 May 2013 17:33:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1368639206!28458465!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8484 invoked from network); 15 May 2013 17:33:27 -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;
	15 May 2013 17:33: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 1UcfZu-00019g-IB
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcfZu-00024v-Fm
	for xen-changelog@lists.xensource.com; Wed, 15 May 2013 17:33:26 +0000
Date: Wed, 15 May 2013 17:33:26 +0000
Message-Id: <E1UcfZu-00024v-Fm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix guest RTE write
	corner cases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 30256a0ff17f6f3b1278b85103187341d5b0ac42
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 15 10:52:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 10:52:02 2013 +0200

    x86/IO-APIC: fix guest RTE write corner cases
    
    This fixes two regressions from c/s 20143:a7de5bd776ca ("x86: Make the
    hypercall PHYSDEVOP_alloc_irq_vector hypercall dummy"):
    
    For one, IRQs that had their vector set up by Xen internally without a
    handler ever having got set (e.g. via "com<n>=..." without a matching
    consumer option like "console=com<n>") would wrongly call
    add_pin_to_irq() here, triggering the BUG_ON() in that function.
    
    Second, when assign_irq_vector() fails this addition to irq_2_pin[]
    needs to be undone.
    
    In the context of this I'm also surprised that the irq_2_pin[]
    manipulations here occur without any lock, i.e. rely on Dom0 to do
    some sort of serialization.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/io_apic.c |   57 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 66c532a..048c61c 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -133,6 +133,37 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin)
     share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
+static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
+{
+    struct irq_pin_list *entry, *prev;
+
+    for (entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next]) {
+        if ((entry->apic == apic) && (entry->pin == pin))
+            break;
+        BUG_ON(!entry->next);
+    }
+
+    entry->pin = entry->apic = -1;
+
+    if (entry != &irq_2_pin[irq]) {
+        /* Removed entry is not at head of list. */
+        prev = &irq_2_pin[irq];
+        while (&irq_2_pin[prev->next] != entry)
+            prev = &irq_2_pin[prev->next];
+        prev->next = entry->next;
+    } else if (entry->next) {
+        /* Removed entry is at head of multi-item list. */
+        prev  = entry;
+        entry = &irq_2_pin[entry->next];
+        *prev = *entry;
+        entry->pin = entry->apic = -1;
+    } else
+        return;
+
+    entry->next = irq_2_pin_free_entry;
+    irq_2_pin_free_entry = entry - irq_2_pin;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -2280,7 +2311,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
-    int apic, pin, irq, ret, vector, pirq;
+    int apic, pin, irq, ret, pirq;
     struct IO_APIC_route_entry rte = { 0 };
     unsigned long flags;
     struct irq_desc *desc;
@@ -2348,13 +2379,25 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         return 0;
     }
 
-    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ) {
-        add_pin_to_irq(irq, apic, pin);
-        vector = assign_irq_vector(irq, NULL);
-        if ( vector < 0 )
-            return vector;
+    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR )
+    {
+        int vector = desc->arch.vector;
+
+        if ( vector < FIRST_HIPRIORITY_VECTOR )
+            add_pin_to_irq(irq, apic, pin);
+        else
+            desc->arch.vector = IRQ_VECTOR_UNASSIGNED;
+        ret = assign_irq_vector(irq, NULL);
+        if ( ret < 0 )
+        {
+            if ( vector < FIRST_HIPRIORITY_VECTOR )
+                remove_pin_from_irq(irq, apic, pin);
+            else
+                desc->arch.vector = vector;
+            return ret;
+        }
 
-        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
     spin_lock(&dom0->event_lock);
     ret = map_domain_pirq(dom0, pirq, irq,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 16 05:33:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 May 2013 05: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 1UcqoP-0002nX-Fl; Thu, 16 May 2013 05:33:09 +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 1UcqoN-0002nN-S0
	for xen-changelog@lists.xensource.com; Thu, 16 May 2013 05:33:08 +0000
Received: from [85.158.139.211:32250] by server-3.bemta-5.messagelabs.com id
	D3/29-31108-39F64915; Thu, 16 May 2013 05:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1368682385!14171630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13126 invoked from network); 16 May 2013 05:33:06 -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;
	16 May 2013 05:33: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 1UcqoK-0006ot-E2
	for xen-changelog@lists.xensource.com; Thu, 16 May 2013 05:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcqoJ-0001ML-31
	for xen-changelog@lists.xensource.com; Thu, 16 May 2013 05:33:03 +0000
Date: Thu, 16 May 2013 05:33:03 +0000
Message-Id: <E1UcqoJ-0001ML-31@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: fix off-by-one in MMIO
	permission check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 afa65ddfd88184a894d9364bec587554c28c20e0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 15 14:34:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 14:34:05 2013 +0200

    x86/shadow: fix off-by-one in MMIO permission check
    
    iomem_access_permitted() wants an inclusive range as input.
    
    Also use pfn_to_paddr() in nearby code instead of open coding it.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e216063..4c4c2ba 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -604,13 +604,13 @@ _sh_propagate(struct vcpu *v,
         else if ( d->arch.hvm_domain.is_in_uc_mode )
             sflags |= pat_type_2_pte_flags(PAT_TYPE_UNCACHABLE);
         else
-            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn) + 1) )
+            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn)) )
             {
                 if ( p2mt == p2m_mmio_direct )
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             MTRR_TYPE_UNCACHABLE); 
                 else if ( iommu_snoop )
                     sflags |= pat_type_2_pte_flags(PAT_TYPE_WRBACK);
@@ -618,7 +618,7 @@ _sh_propagate(struct vcpu *v,
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             NO_HARDCODE_MEM_TYPE);
             }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 16 05:33:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 May 2013 05: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 1UcqoP-0002nX-Fl; Thu, 16 May 2013 05:33:09 +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 1UcqoN-0002nN-S0
	for xen-changelog@lists.xensource.com; Thu, 16 May 2013 05:33:08 +0000
Received: from [85.158.139.211:32250] by server-3.bemta-5.messagelabs.com id
	D3/29-31108-39F64915; Thu, 16 May 2013 05:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1368682385!14171630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13126 invoked from network); 16 May 2013 05:33:06 -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;
	16 May 2013 05:33: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 1UcqoK-0006ot-E2
	for xen-changelog@lists.xensource.com; Thu, 16 May 2013 05:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UcqoJ-0001ML-31
	for xen-changelog@lists.xensource.com; Thu, 16 May 2013 05:33:03 +0000
Date: Thu, 16 May 2013 05:33:03 +0000
Message-Id: <E1UcqoJ-0001ML-31@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/shadow: fix off-by-one in MMIO
	permission check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 afa65ddfd88184a894d9364bec587554c28c20e0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 15 14:34:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 15 14:34:05 2013 +0200

    x86/shadow: fix off-by-one in MMIO permission check
    
    iomem_access_permitted() wants an inclusive range as input.
    
    Also use pfn_to_paddr() in nearby code instead of open coding it.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e216063..4c4c2ba 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -604,13 +604,13 @@ _sh_propagate(struct vcpu *v,
         else if ( d->arch.hvm_domain.is_in_uc_mode )
             sflags |= pat_type_2_pte_flags(PAT_TYPE_UNCACHABLE);
         else
-            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn) + 1) )
+            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn)) )
             {
                 if ( p2mt == p2m_mmio_direct )
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             MTRR_TYPE_UNCACHABLE); 
                 else if ( iommu_snoop )
                     sflags |= pat_type_2_pte_flags(PAT_TYPE_WRBACK);
@@ -618,7 +618,7 @@ _sh_propagate(struct vcpu *v,
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             NO_HARDCODE_MEM_TYPE);
             }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 17 05:33:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 May 2013 05: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 1UdDHy-0003ev-CH; Fri, 17 May 2013 05:33: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 1UdDHw-0003eo-Q1
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:09 +0000
Received: from [193.109.254.147:13408] by server-10.bemta-14.messagelabs.com
	id 0B/8F-05910-311C5915; Fri, 17 May 2013 05:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1368768785!1022911!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1749 invoked from network); 17 May 2013 05:33:06 -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;
	17 May 2013 05:33: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 1UdDHr-0003a9-Hy
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UdDHr-00012T-7g
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:03 +0000
Date: Fri, 17 May 2013 05:33:03 +0000
Message-Id: <E1UdDHr-00012T-7g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vMCE: remove is_vmce_ready check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 71ba77fcf27149a6c75d7d4720f6566f7034ee55
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Thu May 16 10:34:42 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 16 10:34:42 2013 +0200

    x86/vMCE: remove is_vmce_ready check
    
    Remove is_vmce_ready() check since
    1. it's problematic and overkilled: it checks if virq bind to dom0 mcelog
    driver. That's not correct, since mcelog is just a dom0 driver used to log
    error info, irrelated to dom0 vmce injection. It's also overkilled, defaulty
    dom0 disabled mcelog driver, under such case this checking would resulting
    in system crash:
    (XEN) MCE: This error page is ownded by DOM 0
    (XEN) DOM0 not ready for vMCE
    (XEN) domain_crash called from mcaction.c:133
    (XEN) Domain 0 reported crashed by domain 32767 on cpu#31:
    (XEN) Domain 0 crashed: rebooting machine in 5 seconds.
    (XEN) Resetting with ACPI MEMORY or I/O RESET_REG.
    
    2. it's redundant: hypervisor in fact has checked
    1). whether dom0 vmce ready or not (at inject_vmce()), via checking
        vmce trap callback, to make sure vmce injection OK;
    2). whether dom0 mcelog driver ready or not (at mce_softirq()), via
        virq binding, to make sure error log works;
    
    3. it's deprecated: for hvm, it checks whether guest vcpu has different
    virtual family/model with that of host pcpu --> that's deprecated, since
    vMCE has changed a lot, not bound to host MCE any more.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mcaction.c |    6 ---
 xen/arch/x86/cpu/mcheck/vmce.c     |   68 ------------------------------------
 xen/arch/x86/cpu/mcheck/vmce.h     |    1 -
 3 files changed, 0 insertions(+), 75 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mcaction.c b/xen/arch/x86/cpu/mcheck/mcaction.c
index 0ac5b45..adf2ded 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.c
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c
@@ -83,12 +83,6 @@ mc_memerr_dhandler(struct mca_binfo *binfo,
                 ASSERT(d);
                 gfn = get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
 
-                if ( !is_vmce_ready(bank, d) )
-                {
-                    printk("DOM%d not ready for vMCE\n", d->domain_id);
-                    goto vmce_failed;
-                }
-
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index 7d3fac7..af3b491 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -413,74 +413,6 @@ int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     return 0;
 }
 
-static int is_hvm_vmce_ready(struct mcinfo_bank *bank, struct domain *d)
-{
-    struct vcpu *v;
-    int no_vmce = 0, i;
-
-    if (!is_hvm_domain(d))
-        return 0;
-
-    /* kill guest if not enabled vMCE */
-    for_each_vcpu(d, v)
-    {
-        if (!(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_MCE))
-        {
-            no_vmce = 1;
-            break;
-        }
-
-        if (!mce_broadcast)
-            break;
-    }
-
-    if (no_vmce)
-        return 0;
-
-    /* Guest has virtualized family/model information */
-    for ( i = 0; i < MAX_CPUID_INPUT; i++ )
-    {
-        if (d->arch.cpuids[i].input[0] == 0x1)
-        {
-            uint32_t veax = d->arch.cpuids[i].eax, vfam, vmod;
-
-			vfam = (veax >> 8) & 15;
-			vmod = (veax >> 4) & 15;
-
-            if (vfam == 0x6 || vfam == 0xf)
-                vmod += ((veax >> 16) & 0xF) << 4;
-			if (vfam == 0xf)
-				vfam += (veax >> 20) & 0xff;
-
-            if ( ( vfam != boot_cpu_data.x86 ) ||
-                 (vmod != boot_cpu_data.x86_model) )
-            {
-                dprintk(XENLOG_WARNING,
-                    "No vmce for different virtual family/model cpuid\n");
-                no_vmce = 1;
-            }
-            break;
-        }
-    }
-
-    if (no_vmce)
-        return 0;
-
-    return 1;
-}
-
-int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d)
-{
-    if ( d == dom0)
-        return dom0_vmce_enabled();
-
-    /* No vMCE to HVM guest now */
-    if ( is_hvm_domain(d) )
-        return is_hvm_vmce_ready(bank, d);
-
-    return 0;
-}
-
 /* It's said some ram is setup as mmio_direct for UC cache attribute */
 #define P2M_UNMAP_TYPES (p2m_to_mask(p2m_ram_rw) \
                                 | p2m_to_mask(p2m_ram_logdirty) \
diff --git a/xen/arch/x86/cpu/mcheck/vmce.h b/xen/arch/x86/cpu/mcheck/vmce.h
index 7263deb..6b2c95a 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.h
+++ b/xen/arch/x86/cpu/mcheck/vmce.h
@@ -8,7 +8,6 @@ int vmce_init(struct cpuinfo_x86 *c);
 #define dom0_vmce_enabled() (dom0 && dom0->max_vcpus && dom0->vcpu[0] \
         && guest_enabled_event(dom0->vcpu[0], VIRQ_MCA))
 
-int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d);
 int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
 
 int vmce_intel_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 17 05:33:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 May 2013 05: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 1UdDHy-0003ev-CH; Fri, 17 May 2013 05:33: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 1UdDHw-0003eo-Q1
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:09 +0000
Received: from [193.109.254.147:13408] by server-10.bemta-14.messagelabs.com
	id 0B/8F-05910-311C5915; Fri, 17 May 2013 05:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1368768785!1022911!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1749 invoked from network); 17 May 2013 05:33:06 -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;
	17 May 2013 05:33: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 1UdDHr-0003a9-Hy
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UdDHr-00012T-7g
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:03 +0000
Date: Fri, 17 May 2013 05:33:03 +0000
Message-Id: <E1UdDHr-00012T-7g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vMCE: remove is_vmce_ready check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 71ba77fcf27149a6c75d7d4720f6566f7034ee55
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Thu May 16 10:34:42 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 16 10:34:42 2013 +0200

    x86/vMCE: remove is_vmce_ready check
    
    Remove is_vmce_ready() check since
    1. it's problematic and overkilled: it checks if virq bind to dom0 mcelog
    driver. That's not correct, since mcelog is just a dom0 driver used to log
    error info, irrelated to dom0 vmce injection. It's also overkilled, defaulty
    dom0 disabled mcelog driver, under such case this checking would resulting
    in system crash:
    (XEN) MCE: This error page is ownded by DOM 0
    (XEN) DOM0 not ready for vMCE
    (XEN) domain_crash called from mcaction.c:133
    (XEN) Domain 0 reported crashed by domain 32767 on cpu#31:
    (XEN) Domain 0 crashed: rebooting machine in 5 seconds.
    (XEN) Resetting with ACPI MEMORY or I/O RESET_REG.
    
    2. it's redundant: hypervisor in fact has checked
    1). whether dom0 vmce ready or not (at inject_vmce()), via checking
        vmce trap callback, to make sure vmce injection OK;
    2). whether dom0 mcelog driver ready or not (at mce_softirq()), via
        virq binding, to make sure error log works;
    
    3. it's deprecated: for hvm, it checks whether guest vcpu has different
    virtual family/model with that of host pcpu --> that's deprecated, since
    vMCE has changed a lot, not bound to host MCE any more.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mcaction.c |    6 ---
 xen/arch/x86/cpu/mcheck/vmce.c     |   68 ------------------------------------
 xen/arch/x86/cpu/mcheck/vmce.h     |    1 -
 3 files changed, 0 insertions(+), 75 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mcaction.c b/xen/arch/x86/cpu/mcheck/mcaction.c
index 0ac5b45..adf2ded 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.c
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c
@@ -83,12 +83,6 @@ mc_memerr_dhandler(struct mca_binfo *binfo,
                 ASSERT(d);
                 gfn = get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
 
-                if ( !is_vmce_ready(bank, d) )
-                {
-                    printk("DOM%d not ready for vMCE\n", d->domain_id);
-                    goto vmce_failed;
-                }
-
                 if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
                 {
                     printk("Unmap broken memory %lx for DOM%d failed\n",
diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index 7d3fac7..af3b491 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -413,74 +413,6 @@ int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     return 0;
 }
 
-static int is_hvm_vmce_ready(struct mcinfo_bank *bank, struct domain *d)
-{
-    struct vcpu *v;
-    int no_vmce = 0, i;
-
-    if (!is_hvm_domain(d))
-        return 0;
-
-    /* kill guest if not enabled vMCE */
-    for_each_vcpu(d, v)
-    {
-        if (!(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_MCE))
-        {
-            no_vmce = 1;
-            break;
-        }
-
-        if (!mce_broadcast)
-            break;
-    }
-
-    if (no_vmce)
-        return 0;
-
-    /* Guest has virtualized family/model information */
-    for ( i = 0; i < MAX_CPUID_INPUT; i++ )
-    {
-        if (d->arch.cpuids[i].input[0] == 0x1)
-        {
-            uint32_t veax = d->arch.cpuids[i].eax, vfam, vmod;
-
-			vfam = (veax >> 8) & 15;
-			vmod = (veax >> 4) & 15;
-
-            if (vfam == 0x6 || vfam == 0xf)
-                vmod += ((veax >> 16) & 0xF) << 4;
-			if (vfam == 0xf)
-				vfam += (veax >> 20) & 0xff;
-
-            if ( ( vfam != boot_cpu_data.x86 ) ||
-                 (vmod != boot_cpu_data.x86_model) )
-            {
-                dprintk(XENLOG_WARNING,
-                    "No vmce for different virtual family/model cpuid\n");
-                no_vmce = 1;
-            }
-            break;
-        }
-    }
-
-    if (no_vmce)
-        return 0;
-
-    return 1;
-}
-
-int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d)
-{
-    if ( d == dom0)
-        return dom0_vmce_enabled();
-
-    /* No vMCE to HVM guest now */
-    if ( is_hvm_domain(d) )
-        return is_hvm_vmce_ready(bank, d);
-
-    return 0;
-}
-
 /* It's said some ram is setup as mmio_direct for UC cache attribute */
 #define P2M_UNMAP_TYPES (p2m_to_mask(p2m_ram_rw) \
                                 | p2m_to_mask(p2m_ram_logdirty) \
diff --git a/xen/arch/x86/cpu/mcheck/vmce.h b/xen/arch/x86/cpu/mcheck/vmce.h
index 7263deb..6b2c95a 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.h
+++ b/xen/arch/x86/cpu/mcheck/vmce.h
@@ -8,7 +8,6 @@ int vmce_init(struct cpuinfo_x86 *c);
 #define dom0_vmce_enabled() (dom0 && dom0->max_vcpus && dom0->vcpu[0] \
         && guest_enabled_event(dom0->vcpu[0], VIRQ_MCA))
 
-int is_vmce_ready(struct mcinfo_bank *bank, struct domain *d);
 int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
 
 int vmce_intel_rdmsr(const struct vcpu *, uint32_t msr, uint64_t *val);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 17 05:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 May 2013 05: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 1UdDI7-0003g1-H0; Fri, 17 May 2013 05:33: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 1UdDI6-0003fo-Kx
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:18 +0000
Received: from [85.158.139.211:64715] by server-7.bemta-5.messagelabs.com id
	60/71-12828-D11C5915; Fri, 17 May 2013 05:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1368768796!18354255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24957 invoked from network); 17 May 2013 05:33:17 -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;
	17 May 2013 05:33: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 1UdDI3-0003aC-KX
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UdDI3-00012u-FF
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:15 +0000
Date: Fri, 17 May 2013 05:33:15 +0000
Message-Id: <E1UdDI3-00012u-FF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: avoid p2m lookups for vlapic
	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

commit 5d43891bf4002b754cd90d83e91d9190e8c8b9d0
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu May 9 13:06:53 2013 +0100
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu May 16 12:05:25 2013 +0100

    x86/hvm: avoid p2m lookups for vlapic accesses.
    
    The LAPIC base address is a known GFN, so we can skip looking up the
    p2m: we know it should be handled as emulated MMIO.  That helps
    performance in older Windows OSes, which make a _lot_ of TPR accesses.
    
    This will change the behaviour of any OS that maps other
    memory/devices at its LAPIC address; the new behaviour (the LAPIC
    mapping always wins) is closer to actual hardware behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 7c3cb15..bcf9609 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1361,6 +1361,17 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
         }
     }
 
+    /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+     * a fast path for LAPIC accesses, skipping the p2m lookup. */
+    if ( !nestedhvm_vcpu_in_guestmode(v)
+         && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(v))) )
+    {
+        if ( !handle_mmio() )
+            hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        rc = 1;
+        goto out;
+    }
+
     p2m = p2m_get_hostp2m(v->domain);
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
                               P2M_ALLOC | (access_w ? P2M_UNSHARE : 0), NULL);
@@ -2471,6 +2482,12 @@ static enum hvm_copy_result __hvm_copy(
             gfn = addr >> PAGE_SHIFT;
         }
 
+        /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+         * a fast path for LAPIC accesses, skipping the p2m lookup. */
+        if ( !nestedhvm_vcpu_in_guestmode(curr)
+             && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(curr))) )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
         if ( p2m_is_paging(p2mt) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 17 05:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 May 2013 05: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 1UdDI7-0003g1-H0; Fri, 17 May 2013 05:33: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 1UdDI6-0003fo-Kx
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:18 +0000
Received: from [85.158.139.211:64715] by server-7.bemta-5.messagelabs.com id
	60/71-12828-D11C5915; Fri, 17 May 2013 05:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1368768796!18354255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24957 invoked from network); 17 May 2013 05:33:17 -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;
	17 May 2013 05:33: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 1UdDI3-0003aC-KX
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UdDI3-00012u-FF
	for xen-changelog@lists.xensource.com; Fri, 17 May 2013 05:33:15 +0000
Date: Fri, 17 May 2013 05:33:15 +0000
Message-Id: <E1UdDI3-00012u-FF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: avoid p2m lookups for vlapic
	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

commit 5d43891bf4002b754cd90d83e91d9190e8c8b9d0
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu May 9 13:06:53 2013 +0100
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu May 16 12:05:25 2013 +0100

    x86/hvm: avoid p2m lookups for vlapic accesses.
    
    The LAPIC base address is a known GFN, so we can skip looking up the
    p2m: we know it should be handled as emulated MMIO.  That helps
    performance in older Windows OSes, which make a _lot_ of TPR accesses.
    
    This will change the behaviour of any OS that maps other
    memory/devices at its LAPIC address; the new behaviour (the LAPIC
    mapping always wins) is closer to actual hardware behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 7c3cb15..bcf9609 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1361,6 +1361,17 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
         }
     }
 
+    /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+     * a fast path for LAPIC accesses, skipping the p2m lookup. */
+    if ( !nestedhvm_vcpu_in_guestmode(v)
+         && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(v))) )
+    {
+        if ( !handle_mmio() )
+            hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        rc = 1;
+        goto out;
+    }
+
     p2m = p2m_get_hostp2m(v->domain);
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
                               P2M_ALLOC | (access_w ? P2M_UNSHARE : 0), NULL);
@@ -2471,6 +2482,12 @@ static enum hvm_copy_result __hvm_copy(
             gfn = addr >> PAGE_SHIFT;
         }
 
+        /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+         * a fast path for LAPIC accesses, skipping the p2m lookup. */
+        if ( !nestedhvm_vcpu_in_guestmode(curr)
+             && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(curr))) )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
         if ( p2m_is_paging(p2mt) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 21 10:55:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 10:55: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 1UekDj-0001Dc-Ru; Tue, 21 May 2013 10: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 1UekDi-0001DV-PY
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:07 +0000
Received: from [85.158.139.83:4880] by server-7.bemta-5.messagelabs.com id
	72/DE-12828-A825B915; Tue, 21 May 2013 10:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1369133704!28352721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22344 invoked from network); 21 May 2013 10:55:05 -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 May 2013 10:55: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 1UekDf-00073J-J3
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UekDf-0002Ye-6K
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:03 +0000
Date: Tue, 21 May 2013 10:55:03 +0000
Message-Id: <E1UekDf-0002Ye-6K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] piix4acpi, xen,
	vcpu hotplug: Split the notification from the changes.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2133c3847bd2d3e0954e85dadc2ad2606c513cf8
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Tue May 14 18:48:47 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:48:44 2013 +0100

    piix4acpi, xen, vcpu hotplug: Split the notification from the changes.
    
    This is a prepatory patch that splits the notification
    of an vCPU change from the actual changes to the vCPU array.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
---
 hw/piix4acpi.c |   12 ++++++++----
 monitor.c      |    4 ++--
 sysemu.h       |    4 +++-
 xenstore.c     |    7 +++++--
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
index fb1e5c3..54d566b 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -814,22 +814,26 @@ static int disable_processor(GPEState *g, int cpu)
     return 1;
 }
 
-void qemu_cpu_add_remove(int cpu, int state)
+int qemu_cpu_add_remove(int cpu, int state)
 {
     if ((cpu <0) || (cpu >= vcpus)) {
         fprintf(stderr, "vcpu out of range, should be [0~%d]\n", vcpus - 1);
-        return;
+        return -EINVAL;
     }
 
     if (state) {
         if (!enable_processor(&gpe_state, cpu))
-            return;
+            return 0;
     } else {
         if (!disable_processor(&gpe_state, cpu))
-            return;
+            return 0;
     }
     fprintf(logfile, "%s vcpu %d\n", state ? "Add" : "Remove", cpu);
 
+    return 1;
+}
+void qemu_cpu_notify(void)
+{
     if (gpe_state.gpe0_en[0] & 4) {
         qemu_set_irq(sci_irq, 1);
         qemu_set_irq(sci_irq, 0);
diff --git a/monitor.c b/monitor.c
index 8915a6e..fa89c88 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1485,8 +1485,8 @@ static void do_cpu_set_nr(int value, const char *status)
         term_printf("invalid status: %s\n", status);
         return;
     }
-
-    qemu_cpu_add_remove(value, state);
+    if (qemu_cpu_add_remove(value, state))
+        qemu_cpu_notify();
 }
 
 /* Please update qemu-doc.texi when adding or changing commands */
diff --git a/sysemu.h b/sysemu.h
index 66b8ab2..968258a 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -173,9 +173,11 @@ extern int drive_add(const char *file, const char *fmt, ...);
 extern int drive_init(struct drive_opt *arg, int snapshot, void *machine);
 
 /* acpi */
-void qemu_cpu_add_remove(int cpu, int state);
+/* Returns 0 if nothing changed, 1 if added or removed and < 0 for errors. */
+int qemu_cpu_add_remove(int cpu, int state);
 void qemu_system_hot_add_init(void);
 void qemu_system_device_hot_add(int pcibus, int slot, int state);
+void qemu_cpu_notify(void);
 
 /* device-hotplug */
 
diff --git a/xenstore.c b/xenstore.c
index d3a4588..c861d36 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -1005,6 +1005,7 @@ static void xenstore_process_vcpu_set_event(char **vec)
     char *act = NULL;
     char *vcpustr, *node = vec[XS_WATCH_PATH];
     unsigned int vcpu, len;
+    int changed = -EINVAL;
 
     vcpustr = strstr(node, "cpu/");
     if (!vcpustr) {
@@ -1020,13 +1021,15 @@ static void xenstore_process_vcpu_set_event(char **vec)
     }
 
     if (!strncmp(act, "online", len))
-        qemu_cpu_add_remove(vcpu, 1);
+        changed = qemu_cpu_add_remove(vcpu, 1);
     else if (!strncmp(act, "offline", len))
-        qemu_cpu_add_remove(vcpu, 0);
+        changed = qemu_cpu_add_remove(vcpu, 0);
     else
         fprintf(stderr, "vcpu-set: command error.\n");
 
     free(act);
+    if (changed > 0)
+        qemu_cpu_notify();
     return;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-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 May 21 10:55:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 10:55: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 1UekDj-0001Dc-Ru; Tue, 21 May 2013 10: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 1UekDi-0001DV-PY
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:07 +0000
Received: from [85.158.139.83:4880] by server-7.bemta-5.messagelabs.com id
	72/DE-12828-A825B915; Tue, 21 May 2013 10:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1369133704!28352721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22344 invoked from network); 21 May 2013 10:55:05 -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 May 2013 10:55: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 1UekDf-00073J-J3
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UekDf-0002Ye-6K
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:03 +0000
Date: Tue, 21 May 2013 10:55:03 +0000
Message-Id: <E1UekDf-0002Ye-6K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] piix4acpi, xen,
	vcpu hotplug: Split the notification from the changes.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2133c3847bd2d3e0954e85dadc2ad2606c513cf8
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Tue May 14 18:48:47 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:48:44 2013 +0100

    piix4acpi, xen, vcpu hotplug: Split the notification from the changes.
    
    This is a prepatory patch that splits the notification
    of an vCPU change from the actual changes to the vCPU array.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
---
 hw/piix4acpi.c |   12 ++++++++----
 monitor.c      |    4 ++--
 sysemu.h       |    4 +++-
 xenstore.c     |    7 +++++--
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
index fb1e5c3..54d566b 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -814,22 +814,26 @@ static int disable_processor(GPEState *g, int cpu)
     return 1;
 }
 
-void qemu_cpu_add_remove(int cpu, int state)
+int qemu_cpu_add_remove(int cpu, int state)
 {
     if ((cpu <0) || (cpu >= vcpus)) {
         fprintf(stderr, "vcpu out of range, should be [0~%d]\n", vcpus - 1);
-        return;
+        return -EINVAL;
     }
 
     if (state) {
         if (!enable_processor(&gpe_state, cpu))
-            return;
+            return 0;
     } else {
         if (!disable_processor(&gpe_state, cpu))
-            return;
+            return 0;
     }
     fprintf(logfile, "%s vcpu %d\n", state ? "Add" : "Remove", cpu);
 
+    return 1;
+}
+void qemu_cpu_notify(void)
+{
     if (gpe_state.gpe0_en[0] & 4) {
         qemu_set_irq(sci_irq, 1);
         qemu_set_irq(sci_irq, 0);
diff --git a/monitor.c b/monitor.c
index 8915a6e..fa89c88 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1485,8 +1485,8 @@ static void do_cpu_set_nr(int value, const char *status)
         term_printf("invalid status: %s\n", status);
         return;
     }
-
-    qemu_cpu_add_remove(value, state);
+    if (qemu_cpu_add_remove(value, state))
+        qemu_cpu_notify();
 }
 
 /* Please update qemu-doc.texi when adding or changing commands */
diff --git a/sysemu.h b/sysemu.h
index 66b8ab2..968258a 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -173,9 +173,11 @@ extern int drive_add(const char *file, const char *fmt, ...);
 extern int drive_init(struct drive_opt *arg, int snapshot, void *machine);
 
 /* acpi */
-void qemu_cpu_add_remove(int cpu, int state);
+/* Returns 0 if nothing changed, 1 if added or removed and < 0 for errors. */
+int qemu_cpu_add_remove(int cpu, int state);
 void qemu_system_hot_add_init(void);
 void qemu_system_device_hot_add(int pcibus, int slot, int state);
+void qemu_cpu_notify(void);
 
 /* device-hotplug */
 
diff --git a/xenstore.c b/xenstore.c
index d3a4588..c861d36 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -1005,6 +1005,7 @@ static void xenstore_process_vcpu_set_event(char **vec)
     char *act = NULL;
     char *vcpustr, *node = vec[XS_WATCH_PATH];
     unsigned int vcpu, len;
+    int changed = -EINVAL;
 
     vcpustr = strstr(node, "cpu/");
     if (!vcpustr) {
@@ -1020,13 +1021,15 @@ static void xenstore_process_vcpu_set_event(char **vec)
     }
 
     if (!strncmp(act, "online", len))
-        qemu_cpu_add_remove(vcpu, 1);
+        changed = qemu_cpu_add_remove(vcpu, 1);
     else if (!strncmp(act, "offline", len))
-        qemu_cpu_add_remove(vcpu, 0);
+        changed = qemu_cpu_add_remove(vcpu, 0);
     else
         fprintf(stderr, "vcpu-set: command error.\n");
 
     free(act);
+    if (changed > 0)
+        qemu_cpu_notify();
     return;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-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 May 21 10:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 10: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 1UekDt-0001Ee-V4; Tue, 21 May 2013 10:55:17 +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 1UekDs-0001ES-Qb
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:16 +0000
Received: from [85.158.137.99:27697] by server-4.bemta-3.messagelabs.com id
	95/5E-01776-4925B915; Tue, 21 May 2013 10:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1369133714!17704575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22865 invoked from network); 21 May 2013 10:55:15 -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;
	21 May 2013 10:55: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 1UekDp-00073M-P1
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UekDp-0002Za-Me
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:13 +0000
Date: Tue, 21 May 2013 10:55:13 +0000
Message-Id: <E1UekDp-0002Za-Me@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] piix4acpi,
	xen: Clarify that the qemu_set_irq calls just do an IRQ pulse.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 e28e06225c4ee8793f935b0f72fe2d944a2d9b50
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Tue May 14 18:48:48 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:49:14 2013 +0100

    piix4acpi, xen: Clarify that the qemu_set_irq calls just do an IRQ pulse.
    
    The "qemu_cpu_notify" raises and lowers the ACPI SCI line when the
    vCPU state has changed.
    
    Instead of doing the two functions, just use one function that
    describes exactly what it does.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
---
 hw/piix4acpi.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
index 54d566b..bf916d9 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -834,8 +834,6 @@ int qemu_cpu_add_remove(int cpu, int state)
 }
 void qemu_cpu_notify(void)
 {
-    if (gpe_state.gpe0_en[0] & 4) {
-        qemu_set_irq(sci_irq, 1);
-        qemu_set_irq(sci_irq, 0);
-    }
+    if (gpe_state.gpe0_en[0] & 4)
+        qemu_irq_pulse(sci_irq);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-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 May 21 10:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 10: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 1UekDt-0001Ee-V4; Tue, 21 May 2013 10:55:17 +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 1UekDs-0001ES-Qb
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:16 +0000
Received: from [85.158.137.99:27697] by server-4.bemta-3.messagelabs.com id
	95/5E-01776-4925B915; Tue, 21 May 2013 10:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1369133714!17704575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22865 invoked from network); 21 May 2013 10:55:15 -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;
	21 May 2013 10:55: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 1UekDp-00073M-P1
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UekDp-0002Za-Me
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:13 +0000
Date: Tue, 21 May 2013 10:55:13 +0000
Message-Id: <E1UekDp-0002Za-Me@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] piix4acpi,
	xen: Clarify that the qemu_set_irq calls just do an IRQ pulse.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 e28e06225c4ee8793f935b0f72fe2d944a2d9b50
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Tue May 14 18:48:48 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:49:14 2013 +0100

    piix4acpi, xen: Clarify that the qemu_set_irq calls just do an IRQ pulse.
    
    The "qemu_cpu_notify" raises and lowers the ACPI SCI line when the
    vCPU state has changed.
    
    Instead of doing the two functions, just use one function that
    describes exactly what it does.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
---
 hw/piix4acpi.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
index 54d566b..bf916d9 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -834,8 +834,6 @@ int qemu_cpu_add_remove(int cpu, int state)
 }
 void qemu_cpu_notify(void)
 {
-    if (gpe_state.gpe0_en[0] & 4) {
-        qemu_set_irq(sci_irq, 1);
-        qemu_set_irq(sci_irq, 0);
-    }
+    if (gpe_state.gpe0_en[0] & 4)
+        qemu_irq_pulse(sci_irq);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen-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 May 21 10:59:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 10: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 1UekHU-0001WR-0r; Tue, 21 May 2013 10:59:00 +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 1UekHR-0001WE-KU
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:58:57 +0000
Received: from [193.109.254.147:46634] by server-15.bemta-14.messagelabs.com
	id 85/0A-16548-0735B915; Tue, 21 May 2013 10:58:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1369133724!8559440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24317 invoked from network); 21 May 2013 10:55:37 -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;
	21 May 2013 10:55:37 -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 1UekE0-00073S-03
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UekDz-0002Zx-TN
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:23 +0000
Date: Tue, 21 May 2013 10:55:23 +0000
Message-Id: <E1UekDz-0002Zx-TN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] piix4acpi, xen,
	hotplug: Fix race with ACPI AML code and 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 f62079cd7de6ec37f48dfc80fb5906f49fecd6f6
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Tue May 14 18:48:49 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:49:40 2013 +0100

    piix4acpi, xen, hotplug: Fix race with ACPI AML code and hotplug.
    
    This is a race so the amount varies but on a 4PCPU box
    I seem to get only ~14 out of 16 vCPUs I want to online.
    
    The issue at hand is that QEMU xenstore.c hotplug code changes
    the vCPU array and triggers an ACPI SCI for each vCPU
    online/offline change. That means we modify the array of vCPUs
    as the guests ACPI AML code is reading it - resulting in
    the guest reading the data only once and not changing the
    CPU states appropiately.
    
    The fix is to seperate the vCPU array changes from the ACPI SCI
    notification. The code now will enumerate all of the vCPUs
    and change the vCPU array if there is a need for a change.
    If a change did occur then only _one_ ACPI SCI pulse is sent
    to the guest. The vCPU array at that point has the online/offline
    modified to what the user wanted to have.
    
    Specifically, if a user provided this command:
     xl vcpu-set latest 16
    
    (guest config has vcpus=1, maxvcpus=32) QEMU and the guest
    (in this case Linux) would do:
    
    QEMU:                                           Guest OS:
    -xenstore_process_vcpu_set_event
     -> Gets an XenBus notification for CPU1
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
                                                    - ACPI SCI kicks in
    
     -> Gets an XenBus notification for CPU2
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
    
     -> Gets an XenBus notification for CPU3
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
       ...
                                                     - Method(PRST) invoked
    
     -> Gets an XenBus notification for CPU12
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
                                                      - reads AF00 for CPU state
                                                        [gets 0xff]
                                                      - reads AF02 [gets 0x7f]
    
     -> Gets an XenBus notification for CPU13
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
    
            .. until VCPU 16
                                                     - Method PRST updates
                                                       PR01 through 13 FLG
                                                       entry.
                                                     - PR01->PR13 _MAD
                                                       invoked.
    
                                                     - Brings up 13 CPUs.
    
    While QEMU updates the rest of the cpus_state bitfields the ACPI AML
    only does the CPU hotplug on those it had read.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
---
 xenstore.c |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index c861d36..b0d6f77 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -22,6 +22,7 @@
 #include "pci.h"
 #include "qemu-timer.h"
 #include "qemu-xen.h"
+#include "xen_backend.h"
 
 struct xs_handle *xsh = NULL;
 static char *media_filename[MAX_DRIVES+1];
@@ -999,25 +1000,24 @@ void xenstore_record_dm_state(const char *state)
 {
     xenstore_record_dm("state", state);
 }
-
-static void xenstore_process_vcpu_set_event(char **vec)
+static int xenstore_process_one_vcpu_set_event(char *node)
 {
     char *act = NULL;
-    char *vcpustr, *node = vec[XS_WATCH_PATH];
+    char *vcpustr;
     unsigned int vcpu, len;
     int changed = -EINVAL;
 
     vcpustr = strstr(node, "cpu/");
     if (!vcpustr) {
         fprintf(stderr, "vcpu-set: watch node error.\n");
-        return;
+        return changed;
     }
     sscanf(vcpustr, "cpu/%u", &vcpu);
 
     act = xs_read(xsh, XBT_NULL, node, &len);
     if (!act) {
         fprintf(stderr, "vcpu-set: no command yet.\n");
-        return;
+        return changed;
     }
 
     if (!strncmp(act, "online", len))
@@ -1028,8 +1028,61 @@ static void xenstore_process_vcpu_set_event(char **vec)
         fprintf(stderr, "vcpu-set: command error.\n");
 
     free(act);
-    if (changed > 0)
+    return changed;
+}
+static void xenstore_process_vcpu_set_event(char **vec)
+{
+    int changed = 0, rc, i, num = 0;
+    char *vcpu, **dir;
+    char *path = vec[XS_WATCH_PATH];
+
+    /*
+     * Process the event right away in case the loop below fails
+     * to get to vCPU that is in the event.
+     */
+    rc = xenstore_process_one_vcpu_set_event(path);
+    if (rc > 0)
+        changed = 1;
+    /*
+     * We get: /local/domain/<domid>/cpu/<vcpu>/availability or
+     * (at init) /local/domain/<domid>/cpu [ignore it] and need to
+     * iterate over /local/domain/<domid>/cpu/ directory.
+     */
+    vcpu = strstr(path, "cpu/");
+    if (!vcpu) {
+        fprintf(stderr,"[%s]: %s has no CPU!\n", __func__, path);
+        return;
+    }
+    /* Eliminate '/availability' */
+    vcpu[3] = '\0';
+    dir = xs_directory(xsh, XBT_NULL, path, &num);
+
+    if (!dir) {
+        fprintf(stderr, "[%s]: directory %s has no dirs!\n", __func__, path);
+        return;
+    }
+    if (num != vcpus)
+        fprintf(stderr, "[%s]: %d (number of vcpu entries) != %d (maxvcpus)! "\
+                "Continuing on..\n", __func__, num, vcpus);
+
+    for (i = 0; i < num; i++) {
+        char attr[XEN_BUFSIZE];
+
+        /* Construct "/local/domain/<domid>/cpu" (path) with <vcpu> (attr),
+         * and "availability" with '/' sprinkled around. */
+        snprintf(attr, XEN_BUFSIZE, "%s/%s/%s", path, dir[i],  "availability");
+        rc = xenstore_process_one_vcpu_set_event(attr);
+
+        if (rc > 0)
+            changed = 1;
+        if (rc < 0) /* say xs_read failed */
+            break;
+    }
+    free (dir);
+    if (changed > 0) {
+        fprintf(stderr, "Notifying OS about CPU hotplug changes.\n");
         qemu_cpu_notify();
+    }
     return;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-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 May 21 10:59:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 10: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 1UekHU-0001WR-0r; Tue, 21 May 2013 10:59:00 +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 1UekHR-0001WE-KU
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:58:57 +0000
Received: from [193.109.254.147:46634] by server-15.bemta-14.messagelabs.com
	id 85/0A-16548-0735B915; Tue, 21 May 2013 10:58:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1369133724!8559440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24317 invoked from network); 21 May 2013 10:55:37 -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;
	21 May 2013 10:55:37 -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 1UekE0-00073S-03
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UekDz-0002Zx-TN
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 10:55:23 +0000
Date: Tue, 21 May 2013 10:55:23 +0000
Message-Id: <E1UekDz-0002Zx-TN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] piix4acpi, xen,
	hotplug: Fix race with ACPI AML code and 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 f62079cd7de6ec37f48dfc80fb5906f49fecd6f6
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Tue May 14 18:48:49 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:49:40 2013 +0100

    piix4acpi, xen, hotplug: Fix race with ACPI AML code and hotplug.
    
    This is a race so the amount varies but on a 4PCPU box
    I seem to get only ~14 out of 16 vCPUs I want to online.
    
    The issue at hand is that QEMU xenstore.c hotplug code changes
    the vCPU array and triggers an ACPI SCI for each vCPU
    online/offline change. That means we modify the array of vCPUs
    as the guests ACPI AML code is reading it - resulting in
    the guest reading the data only once and not changing the
    CPU states appropiately.
    
    The fix is to seperate the vCPU array changes from the ACPI SCI
    notification. The code now will enumerate all of the vCPUs
    and change the vCPU array if there is a need for a change.
    If a change did occur then only _one_ ACPI SCI pulse is sent
    to the guest. The vCPU array at that point has the online/offline
    modified to what the user wanted to have.
    
    Specifically, if a user provided this command:
     xl vcpu-set latest 16
    
    (guest config has vcpus=1, maxvcpus=32) QEMU and the guest
    (in this case Linux) would do:
    
    QEMU:                                           Guest OS:
    -xenstore_process_vcpu_set_event
     -> Gets an XenBus notification for CPU1
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
                                                    - ACPI SCI kicks in
    
     -> Gets an XenBus notification for CPU2
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
    
     -> Gets an XenBus notification for CPU3
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
       ...
                                                     - Method(PRST) invoked
    
     -> Gets an XenBus notification for CPU12
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
                                                      - reads AF00 for CPU state
                                                        [gets 0xff]
                                                      - reads AF02 [gets 0x7f]
    
     -> Gets an XenBus notification for CPU13
     -> Updates the gpe_state.cpus_state bitfield.
            -> Pulses the ACPI SCI
    
            .. until VCPU 16
                                                     - Method PRST updates
                                                       PR01 through 13 FLG
                                                       entry.
                                                     - PR01->PR13 _MAD
                                                       invoked.
    
                                                     - Brings up 13 CPUs.
    
    While QEMU updates the rest of the cpus_state bitfields the ACPI AML
    only does the CPU hotplug on those it had read.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
---
 xenstore.c |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index c861d36..b0d6f77 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -22,6 +22,7 @@
 #include "pci.h"
 #include "qemu-timer.h"
 #include "qemu-xen.h"
+#include "xen_backend.h"
 
 struct xs_handle *xsh = NULL;
 static char *media_filename[MAX_DRIVES+1];
@@ -999,25 +1000,24 @@ void xenstore_record_dm_state(const char *state)
 {
     xenstore_record_dm("state", state);
 }
-
-static void xenstore_process_vcpu_set_event(char **vec)
+static int xenstore_process_one_vcpu_set_event(char *node)
 {
     char *act = NULL;
-    char *vcpustr, *node = vec[XS_WATCH_PATH];
+    char *vcpustr;
     unsigned int vcpu, len;
     int changed = -EINVAL;
 
     vcpustr = strstr(node, "cpu/");
     if (!vcpustr) {
         fprintf(stderr, "vcpu-set: watch node error.\n");
-        return;
+        return changed;
     }
     sscanf(vcpustr, "cpu/%u", &vcpu);
 
     act = xs_read(xsh, XBT_NULL, node, &len);
     if (!act) {
         fprintf(stderr, "vcpu-set: no command yet.\n");
-        return;
+        return changed;
     }
 
     if (!strncmp(act, "online", len))
@@ -1028,8 +1028,61 @@ static void xenstore_process_vcpu_set_event(char **vec)
         fprintf(stderr, "vcpu-set: command error.\n");
 
     free(act);
-    if (changed > 0)
+    return changed;
+}
+static void xenstore_process_vcpu_set_event(char **vec)
+{
+    int changed = 0, rc, i, num = 0;
+    char *vcpu, **dir;
+    char *path = vec[XS_WATCH_PATH];
+
+    /*
+     * Process the event right away in case the loop below fails
+     * to get to vCPU that is in the event.
+     */
+    rc = xenstore_process_one_vcpu_set_event(path);
+    if (rc > 0)
+        changed = 1;
+    /*
+     * We get: /local/domain/<domid>/cpu/<vcpu>/availability or
+     * (at init) /local/domain/<domid>/cpu [ignore it] and need to
+     * iterate over /local/domain/<domid>/cpu/ directory.
+     */
+    vcpu = strstr(path, "cpu/");
+    if (!vcpu) {
+        fprintf(stderr,"[%s]: %s has no CPU!\n", __func__, path);
+        return;
+    }
+    /* Eliminate '/availability' */
+    vcpu[3] = '\0';
+    dir = xs_directory(xsh, XBT_NULL, path, &num);
+
+    if (!dir) {
+        fprintf(stderr, "[%s]: directory %s has no dirs!\n", __func__, path);
+        return;
+    }
+    if (num != vcpus)
+        fprintf(stderr, "[%s]: %d (number of vcpu entries) != %d (maxvcpus)! "\
+                "Continuing on..\n", __func__, num, vcpus);
+
+    for (i = 0; i < num; i++) {
+        char attr[XEN_BUFSIZE];
+
+        /* Construct "/local/domain/<domid>/cpu" (path) with <vcpu> (attr),
+         * and "availability" with '/' sprinkled around. */
+        snprintf(attr, XEN_BUFSIZE, "%s/%s/%s", path, dir[i],  "availability");
+        rc = xenstore_process_one_vcpu_set_event(attr);
+
+        if (rc > 0)
+            changed = 1;
+        if (rc < 0) /* say xs_read failed */
+            break;
+    }
+    free (dir);
+    if (changed > 0) {
+        fprintf(stderr, "Notifying OS about CPU hotplug changes.\n");
         qemu_cpu_notify();
+    }
     return;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-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 May 21 14:00:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 14:00: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 1Uen6s-0001gK-MT; Tue, 21 May 2013 14:00:14 +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 1Uen6m-0001g6-El
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 14:00:08 +0000
Received: from [85.158.139.83:7395] by server-9.bemta-5.messagelabs.com id
	16/A4-14875-7ED7B915; Tue, 21 May 2013 14:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1369144805!28366798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13193 invoked from network); 21 May 2013 14:00:06 -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;
	21 May 2013 14:00: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 1Uen6i-0000lz-WA
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 14:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uen6g-0006wA-Lo
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 14:00:02 +0000
Date: Tue, 21 May 2013 14:00:02 +0000
Message-Id: <E1Uen6g-0006wA-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] Signed-off-by: Olaf Hering
	<olaf@aepfle.de>
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 70992304dc8c5fc67d876e0f8e3dfaa82be955a1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 21 14:57:23 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 14:58:56 2013 +0100

    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    CC: Eric Shelton <eshelton@pobox.com>
    CC: Matt Wilson <msw@amazon.com>
    CC: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu> (for 4.3 release)
---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 904e019..ace3c3e 100755
--- a/configure
+++ b/configure
@@ -1097,7 +1097,7 @@ fi
 cat > $TMPC <<EOF
 #include <signal.h>
 #include <time.h>
-int main(void) { clockid_t id; return clock_gettime(id, NULL); }
+int main(void) { struct itimerspec v; timer_t t; return timer_gettime (t, &v); }
 EOF
 
 rt=no
--
generated by git-patchbot for /home/xen/git/qemu-xen-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 May 21 14:00:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 May 2013 14:00: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 1Uen6s-0001gK-MT; Tue, 21 May 2013 14:00:14 +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 1Uen6m-0001g6-El
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 14:00:08 +0000
Received: from [85.158.139.83:7395] by server-9.bemta-5.messagelabs.com id
	16/A4-14875-7ED7B915; Tue, 21 May 2013 14:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1369144805!28366798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13193 invoked from network); 21 May 2013 14:00:06 -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;
	21 May 2013 14:00: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 1Uen6i-0000lz-WA
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 14:00:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uen6g-0006wA-Lo
	for xen-changelog@lists.xensource.com; Tue, 21 May 2013 14:00:02 +0000
Date: Tue, 21 May 2013 14:00:02 +0000
Message-Id: <E1Uen6g-0006wA-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] Signed-off-by: Olaf Hering
	<olaf@aepfle.de>
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 70992304dc8c5fc67d876e0f8e3dfaa82be955a1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 21 14:57:23 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 14:58:56 2013 +0100

    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    CC: Eric Shelton <eshelton@pobox.com>
    CC: Matt Wilson <msw@amazon.com>
    CC: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu> (for 4.3 release)
---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 904e019..ace3c3e 100755
--- a/configure
+++ b/configure
@@ -1097,7 +1097,7 @@ fi
 cat > $TMPC <<EOF
 #include <signal.h>
 #include <time.h>
-int main(void) { clockid_t id; return clock_gettime(id, NULL); }
+int main(void) { struct itimerspec v; timer_t t; return timer_gettime (t, &v); }
 EOF
 
 rt=no
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 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 1Uf0je-0005QN-Nr; Wed, 22 May 2013 04:33:10 +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 1Uf0jd-0005QE-1m
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:09 +0000
Received: from [85.158.137.99:3577] by server-3.bemta-3.messagelabs.com id
	36/94-12734-48A4C915; Wed, 22 May 2013 04:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1369197186!17829790!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12214 invoked from network); 22 May 2013 04:33:07 -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;
	22 May 2013 04:33: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 1Uf0jZ-0000yB-Qe
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0jX-0002O5-Up
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:04 +0000
Date: Wed, 22 May 2013 04:33:03 +0000
Message-Id: <E1Uf0jX-0002O5-Up@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: adjust IRQ (de-)assertion
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0047958814457130035=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit f3347f520cb4d8aa4566182b013c6758d80cbe88
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:12:50 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:12:50 2013 +0200

    x86/HVM: adjust IRQ (de-)assertion
    
    De-assertion should only happen when RTC_IRQF gets cleared, i.e. upon
    REG_C reads. Assertion should be done only when the flag transitions
    from 0 to 1.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
---
 xen/arch/x86/hvm/rtc.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index b728d5e..b215886 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -52,23 +52,19 @@ static inline int convert_hour(RTCState *s, int hour);
 
 static void rtc_update_irq(RTCState *s)
 {
-    struct domain *d = vrtc_domain(s);
-    uint8_t irqf;
-
     ASSERT(spin_is_locked(&s->lock));
 
-    /* IRQ is raised if any source is both raised & enabled */
-    irqf = (s->hw.cmos_data[RTC_REG_B]
-            & s->hw.cmos_data[RTC_REG_C]
-            & (RTC_PF|RTC_AF|RTC_UF))
-        ? RTC_IRQF : 0;
+    if ( s->hw.cmos_data[RTC_REG_C] & RTC_IRQF )
+        return;
 
-    s->hw.cmos_data[RTC_REG_C] &= ~RTC_IRQF;
-    s->hw.cmos_data[RTC_REG_C] |= irqf;
+    /* IRQ is raised if any source is both raised & enabled */
+    if ( !(s->hw.cmos_data[RTC_REG_B] &
+           s->hw.cmos_data[RTC_REG_C] &
+           (RTC_PF | RTC_AF | RTC_UF)) )
+        return;
 
-    hvm_isa_irq_deassert(d, RTC_IRQ);
-    if ( irqf )
-        hvm_isa_irq_assert(d, RTC_IRQ);
+    s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+    hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
 void rtc_periodic_interrupt(void *opaque)
@@ -631,6 +627,8 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
+        if ( ret & RTC_IRQF )
+            hvm_isa_irq_deassert(d, RTC_IRQ);
         rtc_update_irq(s);
         check_update_timer(s);
         alarm_timer_update(s);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============0047958814457130035==
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
--===============0047958814457130035==--

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 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 1Uf0je-0005QN-Nr; Wed, 22 May 2013 04:33:10 +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 1Uf0jd-0005QE-1m
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:09 +0000
Received: from [85.158.137.99:3577] by server-3.bemta-3.messagelabs.com id
	36/94-12734-48A4C915; Wed, 22 May 2013 04:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1369197186!17829790!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12214 invoked from network); 22 May 2013 04:33:07 -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;
	22 May 2013 04:33: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 1Uf0jZ-0000yB-Qe
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0jX-0002O5-Up
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:04 +0000
Date: Wed, 22 May 2013 04:33:03 +0000
Message-Id: <E1Uf0jX-0002O5-Up@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: adjust IRQ (de-)assertion
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0047958814457130035=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit f3347f520cb4d8aa4566182b013c6758d80cbe88
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:12:50 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:12:50 2013 +0200

    x86/HVM: adjust IRQ (de-)assertion
    
    De-assertion should only happen when RTC_IRQF gets cleared, i.e. upon
    REG_C reads. Assertion should be done only when the flag transitions
    from 0 to 1.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
---
 xen/arch/x86/hvm/rtc.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index b728d5e..b215886 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -52,23 +52,19 @@ static inline int convert_hour(RTCState *s, int hour);
 
 static void rtc_update_irq(RTCState *s)
 {
-    struct domain *d = vrtc_domain(s);
-    uint8_t irqf;
-
     ASSERT(spin_is_locked(&s->lock));
 
-    /* IRQ is raised if any source is both raised & enabled */
-    irqf = (s->hw.cmos_data[RTC_REG_B]
-            & s->hw.cmos_data[RTC_REG_C]
-            & (RTC_PF|RTC_AF|RTC_UF))
-        ? RTC_IRQF : 0;
+    if ( s->hw.cmos_data[RTC_REG_C] & RTC_IRQF )
+        return;
 
-    s->hw.cmos_data[RTC_REG_C] &= ~RTC_IRQF;
-    s->hw.cmos_data[RTC_REG_C] |= irqf;
+    /* IRQ is raised if any source is both raised & enabled */
+    if ( !(s->hw.cmos_data[RTC_REG_B] &
+           s->hw.cmos_data[RTC_REG_C] &
+           (RTC_PF | RTC_AF | RTC_UF)) )
+        return;
 
-    hvm_isa_irq_deassert(d, RTC_IRQ);
-    if ( irqf )
-        hvm_isa_irq_assert(d, RTC_IRQ);
+    s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+    hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
 void rtc_periodic_interrupt(void *opaque)
@@ -631,6 +627,8 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
+        if ( ret & RTC_IRQF )
+            hvm_isa_irq_deassert(d, RTC_IRQ);
         rtc_update_irq(s);
         check_update_timer(s);
         alarm_timer_update(s);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============0047958814457130035==
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
--===============0047958814457130035==--

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 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 1Uf0jq-0005Qy-Qv; Wed, 22 May 2013 04:33: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 1Uf0jo-0005Qr-VW
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:21 +0000
Received: from [85.158.137.99:3857] by server-1.bemta-3.messagelabs.com id
	B6/88-06847-09A4C915; Wed, 22 May 2013 04:33:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1369197198!12668022!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13496 invoked from network); 22 May 2013 04:33:19 -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;
	22 May 2013 04:33: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 1Uf0jl-0000yE-Ux
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0jk-0002Ob-18
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:16 +0000
Date: Wed, 22 May 2013 04:33:16 +0000
Message-Id: <E1Uf0jk-0002Ob-18@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly handle RTC periodic
	timer even when !RTC_PIE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5103760253783902864=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 9607327abbd3e77bde6cc7b5327f3efd781fc06e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:14:21 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:14:21 2013 +0200

    x86/HVM: properly handle RTC periodic timer even when !RTC_PIE
    
    Since in that case the processing it pt_intr_post() won't occur, we
    need to do some additional work in pt_update_irq(). Additionally we
    must not pay attention to the respective IRQ being masked.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
---
 xen/arch/x86/hvm/rtc.c        |    8 ++++++-
 xen/arch/x86/hvm/vpt.c        |   47 +++++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vpt.h |    2 +-
 3 files changed, 51 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index b215886..77b380f 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -67,11 +67,13 @@ static void rtc_update_irq(RTCState *s)
     hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
-void rtc_periodic_interrupt(void *opaque)
+bool_t rtc_periodic_interrupt(void *opaque)
 {
     RTCState *s = opaque;
+    bool_t ret;
 
     spin_lock(&s->lock);
+    ret = !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
     if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
     {
         s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
@@ -83,7 +85,11 @@ void rtc_periodic_interrupt(void *opaque)
         destroy_periodic_time(&s->pt);
         s->pt_code = 0;
     }
+    if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
+        ret = 0;
     spin_unlock(&s->lock);
+
+    return ret;
 }
 
 /* Enable/configure/disable the periodic timer based on the RTC_PIE and
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 3fb0406..8dee662 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -216,18 +216,23 @@ static void pt_timer_fn(void *data)
 int pt_update_irq(struct vcpu *v)
 {
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
-    struct periodic_time *pt, *temp, *earliest_pt = NULL;
-    uint64_t max_lag = -1ULL;
+    struct periodic_time *pt, *temp, *earliest_pt;
+    uint64_t max_lag;
     int irq, is_lapic;
     void *pt_priv;
 
+ rescan:
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
+ rescan_locked:
+    earliest_pt = NULL;
+    max_lag = -1ULL;
     list_for_each_entry_safe ( pt, temp, head, list )
     {
         if ( pt->pending_intr_nr )
         {
-            if ( pt_irq_masked(pt) )
+            /* RTC code takes care of disabling the timer itself. */
+            if ( (pt->irq != RTC_IRQ || !pt->priv) && pt_irq_masked(pt) )
             {
                 /* suspend timer emulation */
                 list_del(&pt->list);
@@ -260,7 +265,41 @@ int pt_update_irq(struct vcpu *v)
     if ( is_lapic )
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
     else if ( irq == RTC_IRQ && pt_priv )
-        rtc_periodic_interrupt(pt_priv);
+    {
+        if ( !rtc_periodic_interrupt(pt_priv) )
+            irq = -1;
+
+        pt_lock(earliest_pt);
+
+        if ( irq < 0 && earliest_pt->pending_intr_nr )
+        {
+            /*
+             * RTC periodic timer runs without the corresponding interrupt
+             * being enabled - need to mimic enough of pt_intr_post() to keep
+             * things going.
+             */
+            earliest_pt->pending_intr_nr = 0;
+            earliest_pt->irq_issued = 0;
+            set_timer(&earliest_pt->timer, earliest_pt->scheduled);
+        }
+        else if ( irq >= 0 && pt_irq_masked(earliest_pt) )
+        {
+            if ( earliest_pt->on_list )
+            {
+                /* suspend timer emulation */
+                list_del(&earliest_pt->list);
+                earliest_pt->on_list = 0;
+            }
+            irq = -1;
+        }
+
+        /* Avoid dropping the lock if we can. */
+        if ( irq < 0 && v == earliest_pt->vcpu )
+            goto rescan_locked;
+        pt_unlock(earliest_pt);
+        if ( irq < 0 )
+            goto rescan;
+    }
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 765fbb7..87c3a66 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -183,7 +183,7 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
-void rtc_periodic_interrupt(void *);
+bool_t rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============5103760253783902864==
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
--===============5103760253783902864==--

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 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 1Uf0jq-0005Qy-Qv; Wed, 22 May 2013 04:33: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 1Uf0jo-0005Qr-VW
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:21 +0000
Received: from [85.158.137.99:3857] by server-1.bemta-3.messagelabs.com id
	B6/88-06847-09A4C915; Wed, 22 May 2013 04:33:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1369197198!12668022!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13496 invoked from network); 22 May 2013 04:33:19 -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;
	22 May 2013 04:33: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 1Uf0jl-0000yE-Ux
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0jk-0002Ob-18
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:16 +0000
Date: Wed, 22 May 2013 04:33:16 +0000
Message-Id: <E1Uf0jk-0002Ob-18@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly handle RTC periodic
	timer even when !RTC_PIE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5103760253783902864=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 9607327abbd3e77bde6cc7b5327f3efd781fc06e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:14:21 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:14:21 2013 +0200

    x86/HVM: properly handle RTC periodic timer even when !RTC_PIE
    
    Since in that case the processing it pt_intr_post() won't occur, we
    need to do some additional work in pt_update_irq(). Additionally we
    must not pay attention to the respective IRQ being masked.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
---
 xen/arch/x86/hvm/rtc.c        |    8 ++++++-
 xen/arch/x86/hvm/vpt.c        |   47 +++++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vpt.h |    2 +-
 3 files changed, 51 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index b215886..77b380f 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -67,11 +67,13 @@ static void rtc_update_irq(RTCState *s)
     hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
-void rtc_periodic_interrupt(void *opaque)
+bool_t rtc_periodic_interrupt(void *opaque)
 {
     RTCState *s = opaque;
+    bool_t ret;
 
     spin_lock(&s->lock);
+    ret = !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
     if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
     {
         s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
@@ -83,7 +85,11 @@ void rtc_periodic_interrupt(void *opaque)
         destroy_periodic_time(&s->pt);
         s->pt_code = 0;
     }
+    if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
+        ret = 0;
     spin_unlock(&s->lock);
+
+    return ret;
 }
 
 /* Enable/configure/disable the periodic timer based on the RTC_PIE and
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 3fb0406..8dee662 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -216,18 +216,23 @@ static void pt_timer_fn(void *data)
 int pt_update_irq(struct vcpu *v)
 {
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
-    struct periodic_time *pt, *temp, *earliest_pt = NULL;
-    uint64_t max_lag = -1ULL;
+    struct periodic_time *pt, *temp, *earliest_pt;
+    uint64_t max_lag;
     int irq, is_lapic;
     void *pt_priv;
 
+ rescan:
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
+ rescan_locked:
+    earliest_pt = NULL;
+    max_lag = -1ULL;
     list_for_each_entry_safe ( pt, temp, head, list )
     {
         if ( pt->pending_intr_nr )
         {
-            if ( pt_irq_masked(pt) )
+            /* RTC code takes care of disabling the timer itself. */
+            if ( (pt->irq != RTC_IRQ || !pt->priv) && pt_irq_masked(pt) )
             {
                 /* suspend timer emulation */
                 list_del(&pt->list);
@@ -260,7 +265,41 @@ int pt_update_irq(struct vcpu *v)
     if ( is_lapic )
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
     else if ( irq == RTC_IRQ && pt_priv )
-        rtc_periodic_interrupt(pt_priv);
+    {
+        if ( !rtc_periodic_interrupt(pt_priv) )
+            irq = -1;
+
+        pt_lock(earliest_pt);
+
+        if ( irq < 0 && earliest_pt->pending_intr_nr )
+        {
+            /*
+             * RTC periodic timer runs without the corresponding interrupt
+             * being enabled - need to mimic enough of pt_intr_post() to keep
+             * things going.
+             */
+            earliest_pt->pending_intr_nr = 0;
+            earliest_pt->irq_issued = 0;
+            set_timer(&earliest_pt->timer, earliest_pt->scheduled);
+        }
+        else if ( irq >= 0 && pt_irq_masked(earliest_pt) )
+        {
+            if ( earliest_pt->on_list )
+            {
+                /* suspend timer emulation */
+                list_del(&earliest_pt->list);
+                earliest_pt->on_list = 0;
+            }
+            irq = -1;
+        }
+
+        /* Avoid dropping the lock if we can. */
+        if ( irq < 0 && v == earliest_pt->vcpu )
+            goto rescan_locked;
+        pt_unlock(earliest_pt);
+        if ( irq < 0 )
+            goto rescan;
+    }
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 765fbb7..87c3a66 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -183,7 +183,7 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
-void rtc_periodic_interrupt(void *);
+bool_t rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============5103760253783902864==
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
--===============5103760253783902864==--

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 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 1Uf0k0-0005SR-UH; Wed, 22 May 2013 04:33:32 +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 1Uf0jz-0005S8-Ap
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:31 +0000
Received: from [85.158.139.83:45415] by server-3.bemta-5.messagelabs.com id
	58/9C-31108-A9A4C915; Wed, 22 May 2013 04:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1369197208!25720889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30222 invoked from network); 22 May 2013 04:33:29 -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;
	22 May 2013 04:33: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 1Uf0jw-0000yM-Cl
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0jw-0002Pg-2i
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:28 +0000
Date: Wed, 22 May 2013 04:33:28 +0000
Message-Id: <E1Uf0jw-0002Pg-2i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: RTC code must be in line with
	WAET flags passed by hvmloader
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============3330578032926649427=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 3fa7fb8b86b89167153fa457b27620436d648969
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:15:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:15:13 2013 +0200

    x86/HVM: RTC code must be in line with WAET flags passed by hvmloader
    
    With hvmloader telling the guest that it may skip REG_C reads during
    the processing of RTC interrupts, the emulation code must not depend
    upon these reads to occur. Introduce two modes of operation for the
    emulation code, and short of a HVM parameter (too late to be
    introduced for 4.3) hard code the mode determination to always assume
    that Windows-conforming one for the time being.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
---
 tools/firmware/hvmloader/acpi/static_tables.c |   12 ++++++++----
 xen/arch/x86/hvm/rtc.c                        |   19 +++++++++++++++----
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/static_tables.c b/tools/firmware/hvmloader/acpi/static_tables.c
index f98c8d2..323ae31 100644
--- a/tools/firmware/hvmloader/acpi/static_tables.c
+++ b/tools/firmware/hvmloader/acpi/static_tables.c
@@ -136,11 +136,15 @@ struct acpi_20_rsdp Rsdp = {
     .length    = sizeof(struct acpi_20_rsdp)
 };
 
-#define ACPI_WAET_RTC_GOOD      0x00000001
-#define ACPI_WAET_PM_TIMER_GOOD 0x00000002
+#define ACPI_WAET_RTC_NO_ACK        (1<<0) /* RTC requires no int acknowledge */
+#define ACPI_WAET_TIMER_ONE_READ    (1<<1) /* PM timer requires only one read */
 
-#define ACPI_WAET_FLAGS (ACPI_WAET_RTC_GOOD | \
-                         ACPI_WAET_PM_TIMER_GOOD)
+/*
+ * The state of the RTC flag getting passed to the guest must be in
+ * sync with the mode selection in the hypervisor RTC emulation code.
+ */
+#define ACPI_WAET_FLAGS (ACPI_WAET_RTC_NO_ACK | \
+                         ACPI_WAET_TIMER_ONE_READ)
 
 struct acpi_20_waet Waet = {
     .header = {
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 77b380f..d1a6848 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -45,6 +45,15 @@
 #define epoch_year     1900
 #define get_year(x)    (x + epoch_year)
 
+enum rtc_mode {
+   rtc_mode_no_ack,
+   rtc_mode_strict
+};
+
+/* This must be in sync with how hvmloader sets the ACPI WAET flags. */
+#define mode_is(d, m) ((void)(d), rtc_mode_##m == rtc_mode_no_ack)
+#define rtc_mode_is(s, m) mode_is(vrtc_domain(s), m)
+
 static void rtc_copy_date(RTCState *s);
 static void rtc_set_time(RTCState *s);
 static inline int from_bcd(RTCState *s, int a);
@@ -54,7 +63,7 @@ static void rtc_update_irq(RTCState *s)
 {
     ASSERT(spin_is_locked(&s->lock));
 
-    if ( s->hw.cmos_data[RTC_REG_C] & RTC_IRQF )
+    if ( rtc_mode_is(s, strict) && (s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
         return;
 
     /* IRQ is raised if any source is both raised & enabled */
@@ -64,6 +73,8 @@ static void rtc_update_irq(RTCState *s)
         return;
 
     s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+    if ( rtc_mode_is(s, no_ack) )
+        hvm_isa_irq_deassert(vrtc_domain(s), RTC_IRQ);
     hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
@@ -73,8 +84,8 @@ bool_t rtc_periodic_interrupt(void *opaque)
     bool_t ret;
 
     spin_lock(&s->lock);
-    ret = !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
-    if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
+    ret = rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
+    if ( rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
     {
         s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
         rtc_update_irq(s);
@@ -633,7 +644,7 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
-        if ( ret & RTC_IRQF )
+        if ( (ret & RTC_IRQF) && !rtc_mode_is(s, no_ack) )
             hvm_isa_irq_deassert(d, RTC_IRQ);
         rtc_update_irq(s);
         check_update_timer(s);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3330578032926649427==
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
--===============3330578032926649427==--

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 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 1Uf0k0-0005SR-UH; Wed, 22 May 2013 04:33:32 +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 1Uf0jz-0005S8-Ap
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:31 +0000
Received: from [85.158.139.83:45415] by server-3.bemta-5.messagelabs.com id
	58/9C-31108-A9A4C915; Wed, 22 May 2013 04:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1369197208!25720889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30222 invoked from network); 22 May 2013 04:33:29 -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;
	22 May 2013 04:33: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 1Uf0jw-0000yM-Cl
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0jw-0002Pg-2i
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:28 +0000
Date: Wed, 22 May 2013 04:33:28 +0000
Message-Id: <E1Uf0jw-0002Pg-2i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: RTC code must be in line with
	WAET flags passed by hvmloader
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============3330578032926649427=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 3fa7fb8b86b89167153fa457b27620436d648969
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:15:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:15:13 2013 +0200

    x86/HVM: RTC code must be in line with WAET flags passed by hvmloader
    
    With hvmloader telling the guest that it may skip REG_C reads during
    the processing of RTC interrupts, the emulation code must not depend
    upon these reads to occur. Introduce two modes of operation for the
    emulation code, and short of a HVM parameter (too late to be
    introduced for 4.3) hard code the mode determination to always assume
    that Windows-conforming one for the time being.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
---
 tools/firmware/hvmloader/acpi/static_tables.c |   12 ++++++++----
 xen/arch/x86/hvm/rtc.c                        |   19 +++++++++++++++----
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/static_tables.c b/tools/firmware/hvmloader/acpi/static_tables.c
index f98c8d2..323ae31 100644
--- a/tools/firmware/hvmloader/acpi/static_tables.c
+++ b/tools/firmware/hvmloader/acpi/static_tables.c
@@ -136,11 +136,15 @@ struct acpi_20_rsdp Rsdp = {
     .length    = sizeof(struct acpi_20_rsdp)
 };
 
-#define ACPI_WAET_RTC_GOOD      0x00000001
-#define ACPI_WAET_PM_TIMER_GOOD 0x00000002
+#define ACPI_WAET_RTC_NO_ACK        (1<<0) /* RTC requires no int acknowledge */
+#define ACPI_WAET_TIMER_ONE_READ    (1<<1) /* PM timer requires only one read */
 
-#define ACPI_WAET_FLAGS (ACPI_WAET_RTC_GOOD | \
-                         ACPI_WAET_PM_TIMER_GOOD)
+/*
+ * The state of the RTC flag getting passed to the guest must be in
+ * sync with the mode selection in the hypervisor RTC emulation code.
+ */
+#define ACPI_WAET_FLAGS (ACPI_WAET_RTC_NO_ACK | \
+                         ACPI_WAET_TIMER_ONE_READ)
 
 struct acpi_20_waet Waet = {
     .header = {
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 77b380f..d1a6848 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -45,6 +45,15 @@
 #define epoch_year     1900
 #define get_year(x)    (x + epoch_year)
 
+enum rtc_mode {
+   rtc_mode_no_ack,
+   rtc_mode_strict
+};
+
+/* This must be in sync with how hvmloader sets the ACPI WAET flags. */
+#define mode_is(d, m) ((void)(d), rtc_mode_##m == rtc_mode_no_ack)
+#define rtc_mode_is(s, m) mode_is(vrtc_domain(s), m)
+
 static void rtc_copy_date(RTCState *s);
 static void rtc_set_time(RTCState *s);
 static inline int from_bcd(RTCState *s, int a);
@@ -54,7 +63,7 @@ static void rtc_update_irq(RTCState *s)
 {
     ASSERT(spin_is_locked(&s->lock));
 
-    if ( s->hw.cmos_data[RTC_REG_C] & RTC_IRQF )
+    if ( rtc_mode_is(s, strict) && (s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
         return;
 
     /* IRQ is raised if any source is both raised & enabled */
@@ -64,6 +73,8 @@ static void rtc_update_irq(RTCState *s)
         return;
 
     s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+    if ( rtc_mode_is(s, no_ack) )
+        hvm_isa_irq_deassert(vrtc_domain(s), RTC_IRQ);
     hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
@@ -73,8 +84,8 @@ bool_t rtc_periodic_interrupt(void *opaque)
     bool_t ret;
 
     spin_lock(&s->lock);
-    ret = !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
-    if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
+    ret = rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
+    if ( rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
     {
         s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
         rtc_update_irq(s);
@@ -633,7 +644,7 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
-        if ( ret & RTC_IRQF )
+        if ( (ret & RTC_IRQF) && !rtc_mode_is(s, no_ack) )
             hvm_isa_irq_deassert(d, RTC_IRQ);
         rtc_update_irq(s);
         check_update_timer(s);
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3330578032926649427==
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
--===============3330578032926649427==--

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:33: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 1Uf0kB-0005U1-15; Wed, 22 May 2013 04:33: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 1Uf0k9-0005Ti-D9
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:41 +0000
Received: from [85.158.137.99:6524] by server-8.bemta-3.messagelabs.com id
	12/85-25864-4AA4C915; Wed, 22 May 2013 04:33:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1369197218!17780671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21892 invoked from network); 22 May 2013 04:33: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;
	22 May 2013 04:33: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 1Uf0k6-0000yT-Jr
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0k6-0002Q6-HY
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:38 +0000
Date: Wed, 22 May 2013 04:33:38 +0000
Message-Id: <E1Uf0k6-0002Q6-HY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: fix dependency file generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4d788e164d6556d931bc3e0a69e36b8cf7280794
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:16:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:16:30 2013 +0200

    tools: fix dependency file generation
    
    There is a small set of places where files in subdirectories get
    compiled from the parent directory. Dependency file wise this is no
    problem as long as the files use names distinct without regard to the
    directories they sit in, and tools/console/ violates this (in having
    two main.c files). Hence we need to avoid losing the directory name,
    both to ensure the two compiler instances don't simultaneously write
    to the same file (happening of which is what triggered me looking
    into this) and to guarantee dependencies for all files will be seen
    by make on an incremental rebuild.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Rules.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 3f03a31..13d8fc1 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -62,7 +62,7 @@ SHLIB_libxenlight  = -Wl,-rpath-link=$(XEN_XENLIGHT)
 CFLAGS += -D__XEN_TOOLS__
 
 # Get gcc to generate the dependencies for us.
-CFLAGS += -MMD -MF .$(@F).d
+CFLAGS += -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
 DEPS = .*.d
 
 ifneq ($(FILE_OFFSET_BITS),)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:33: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 1Uf0kB-0005U1-15; Wed, 22 May 2013 04:33: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 1Uf0k9-0005Ti-D9
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:41 +0000
Received: from [85.158.137.99:6524] by server-8.bemta-3.messagelabs.com id
	12/85-25864-4AA4C915; Wed, 22 May 2013 04:33:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1369197218!17780671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21892 invoked from network); 22 May 2013 04:33: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;
	22 May 2013 04:33: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 1Uf0k6-0000yT-Jr
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0k6-0002Q6-HY
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:38 +0000
Date: Wed, 22 May 2013 04:33:38 +0000
Message-Id: <E1Uf0k6-0002Q6-HY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: fix dependency file generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 4d788e164d6556d931bc3e0a69e36b8cf7280794
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 10:16:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 10:16:30 2013 +0200

    tools: fix dependency file generation
    
    There is a small set of places where files in subdirectories get
    compiled from the parent directory. Dependency file wise this is no
    problem as long as the files use names distinct without regard to the
    directories they sit in, and tools/console/ violates this (in having
    two main.c files). Hence we need to avoid losing the directory name,
    both to ensure the two compiler instances don't simultaneously write
    to the same file (happening of which is what triggered me looking
    into this) and to guarantee dependencies for all files will be seen
    by make on an incremental rebuild.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Rules.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 3f03a31..13d8fc1 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -62,7 +62,7 @@ SHLIB_libxenlight  = -Wl,-rpath-link=$(XEN_XENLIGHT)
 CFLAGS += -D__XEN_TOOLS__
 
 # Get gcc to generate the dependencies for us.
-CFLAGS += -MMD -MF .$(@F).d
+CFLAGS += -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
 DEPS = .*.d
 
 ifneq ($(FILE_OFFSET_BITS),)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:33: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 1Uf0kL-0005Vn-4A; Wed, 22 May 2013 04:33: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 1Uf0kJ-0005VJ-Ff
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:51 +0000
Received: from [85.158.143.99:62522] by server-2.bemta-4.messagelabs.com id
	62/0C-27124-EAA4C915; Wed, 22 May 2013 04:33:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1369197228!22325107!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14727 invoked from network); 22 May 2013 04:33:49 -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;
	22 May 2013 04:33:49 -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 1Uf0kG-0000ye-Oq
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0kG-0002QY-N2
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:48 +0000
Date: Wed, 22 May 2013 04:33:48 +0000
Message-Id: <E1Uf0kG-0002QY-N2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix XSA-46 regression with xend/xm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 934a5253d932b6f67fe40fc48975a2b0117e4cce
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 11:32:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 11:32:34 2013 +0200

    fix XSA-46 regression with xend/xm
    
    The hypervisor side changes for XSA-46 require the tool stack to now
    always map the guest pIRQ before granting access permission to the
    underlying host IRQ (GSI). This in particular requires that pciif.py
    no longer can skip this step (assuming qemu would do it) for HVM
    guests.
    
    This in turn exposes, however, an inconsistency between xend and qemu:
    The former wants to always establish 1:1 mappings between pIRQ and host
    IRQ (for non-MSI only of course), while the latter always wants to
    allocate an arbitrary mapping. Since the whole tool stack obviously
    should always agree on the mapping model, make libxc enforce the 1:1
    mapping as the more natural one (as well as being the one that allows
    for easier debugging, since there no need to find out the extra
    mapping). Users of libxc that want to establish a particular (rather
    than an allocated) mapping are still free to do so, as well as tool
    stacks not based on libxc wanting to implement an allocation based
    model (which is why it's not the hypervisor that's being changed to
    enforce either model).
    
    Since libxl, like xend, already uses a 1:1 model, it's unaffected by
    the libxc change (and it being unaffected by the original hypervisor
    side changes is - afaict - simply due to qemu getting spawned at a
    later point in time compared to the xend event flow).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
    Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_physdev.c              |    2 +-
 tools/python/xen/xend/server/pciif.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index bdbcba7..cf02d85 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
     map.domid = domid;
     map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
-    map.pirq = *pirq;
+    map.pirq = *pirq < 0 ? index : *pirq;
 
     rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
 
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
index 43d0c80..27c1b75 100644
--- a/tools/python/xen/xend/server/pciif.py
+++ b/tools/python/xen/xend/server/pciif.py
@@ -340,7 +340,7 @@ class PciController(DevController):
                 raise VmError(('pci: failed to configure I/O memory on device '+
                             '%s - errno=%d')%(dev.name,rc))
 
-        if not self.vm.info.is_hvm() and dev.irq:
+        if dev.irq > 0:
             rc = xc.physdev_map_pirq(domid = fe_domid,
                                    index = dev.irq,
                                    pirq  = dev.irq)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:33:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:33: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 1Uf0kL-0005Vn-4A; Wed, 22 May 2013 04:33: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 1Uf0kJ-0005VJ-Ff
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:51 +0000
Received: from [85.158.143.99:62522] by server-2.bemta-4.messagelabs.com id
	62/0C-27124-EAA4C915; Wed, 22 May 2013 04:33:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1369197228!22325107!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14727 invoked from network); 22 May 2013 04:33:49 -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;
	22 May 2013 04:33:49 -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 1Uf0kG-0000ye-Oq
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0kG-0002QY-N2
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:48 +0000
Date: Wed, 22 May 2013 04:33:48 +0000
Message-Id: <E1Uf0kG-0002QY-N2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix XSA-46 regression with xend/xm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 934a5253d932b6f67fe40fc48975a2b0117e4cce
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 21 11:32:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 21 11:32:34 2013 +0200

    fix XSA-46 regression with xend/xm
    
    The hypervisor side changes for XSA-46 require the tool stack to now
    always map the guest pIRQ before granting access permission to the
    underlying host IRQ (GSI). This in particular requires that pciif.py
    no longer can skip this step (assuming qemu would do it) for HVM
    guests.
    
    This in turn exposes, however, an inconsistency between xend and qemu:
    The former wants to always establish 1:1 mappings between pIRQ and host
    IRQ (for non-MSI only of course), while the latter always wants to
    allocate an arbitrary mapping. Since the whole tool stack obviously
    should always agree on the mapping model, make libxc enforce the 1:1
    mapping as the more natural one (as well as being the one that allows
    for easier debugging, since there no need to find out the extra
    mapping). Users of libxc that want to establish a particular (rather
    than an allocated) mapping are still free to do so, as well as tool
    stacks not based on libxc wanting to implement an allocation based
    model (which is why it's not the hypervisor that's being changed to
    enforce either model).
    
    Since libxl, like xend, already uses a 1:1 model, it's unaffected by
    the libxc change (and it being unaffected by the original hypervisor
    side changes is - afaict - simply due to qemu getting spawned at a
    later point in time compared to the xend event flow).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
    Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_physdev.c              |    2 +-
 tools/python/xen/xend/server/pciif.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index bdbcba7..cf02d85 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
     map.domid = domid;
     map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
-    map.pirq = *pirq;
+    map.pirq = *pirq < 0 ? index : *pirq;
 
     rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
 
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
index 43d0c80..27c1b75 100644
--- a/tools/python/xen/xend/server/pciif.py
+++ b/tools/python/xen/xend/server/pciif.py
@@ -340,7 +340,7 @@ class PciController(DevController):
                 raise VmError(('pci: failed to configure I/O memory on device '+
                             '%s - errno=%d')%(dev.name,rc))
 
-        if not self.vm.info.is_hvm() and dev.irq:
+        if dev.irq > 0:
             rc = xc.physdev_map_pirq(domid = fe_domid,
                                    index = dev.irq,
                                    pirq  = dev.irq)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:34:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:34: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 1Uf0kW-0005Y6-7A; Wed, 22 May 2013 04:34:04 +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 1Uf0kT-0005XV-Kr
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:01 +0000
Received: from [85.158.137.99:6999] by server-2.bemta-3.messagelabs.com id
	33/47-24763-8BA4C915; Wed, 22 May 2013 04:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1369197239!16932270!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26051 invoked from network); 22 May 2013 04:34:00 -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;
	22 May 2013 04:34: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 1Uf0kQ-0000yq-Vo
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0kQ-0002RD-T2
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:58 +0000
Date: Wed, 22 May 2013 04:33:58 +0000
Message-Id: <E1Uf0kQ-0002RD-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] 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

commit e482d9f047c1e6f2369b598925eb2dadf4e38308
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 21 11:50:57 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:50:57 2013 +0100

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index dc0d49e..5256ca7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.3.0-rc1
-# Fri Mar 15 18:25:15 2013 +0000
-# xen: Disable use of O_DIRECT by default as it results in crashes.
+QEMU_TAG ?= f62079cd7de6ec37f48dfc80fb5906f49fecd6f6
+# Tue May 14 18:48:49 2013 +0100
+# piix4acpi, xen, hotplug: Fix race with ACPI AML code and hotplug.
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:34:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:34: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 1Uf0kW-0005Y6-7A; Wed, 22 May 2013 04:34:04 +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 1Uf0kT-0005XV-Kr
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:01 +0000
Received: from [85.158.137.99:6999] by server-2.bemta-3.messagelabs.com id
	33/47-24763-8BA4C915; Wed, 22 May 2013 04:34:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1369197239!16932270!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26051 invoked from network); 22 May 2013 04:34:00 -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;
	22 May 2013 04:34: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 1Uf0kQ-0000yq-Vo
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0kQ-0002RD-T2
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:33:58 +0000
Date: Wed, 22 May 2013 04:33:58 +0000
Message-Id: <E1Uf0kQ-0002RD-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] 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

commit e482d9f047c1e6f2369b598925eb2dadf4e38308
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 21 11:50:57 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 11:50:57 2013 +0100

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index dc0d49e..5256ca7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.3.0-rc1
-# Fri Mar 15 18:25:15 2013 +0000
-# xen: Disable use of O_DIRECT by default as it results in crashes.
+QEMU_TAG ?= f62079cd7de6ec37f48dfc80fb5906f49fecd6f6
+# Tue May 14 18:48:49 2013 +0100
+# piix4acpi, xen, hotplug: Fix race with ACPI AML code and hotplug.
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:34:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:34: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 1Uf0kf-0005bf-CO; Wed, 22 May 2013 04:34: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 1Uf0ke-0005az-42
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:12 +0000
Received: from [85.158.138.51:3640] by server-3.bemta-3.messagelabs.com id
	30/25-12734-3CA4C915; Wed, 22 May 2013 04:34:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1369197249!27936719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1680 invoked from network); 22 May 2013 04:34:10 -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;
	22 May 2013 04:34: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 1Uf0kb-0000zN-7c
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0kb-0002Rk-4K
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:09 +0000
Date: Wed, 22 May 2013 04:34:09 +0000
Message-Id: <E1Uf0kb-0002Rk-4K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] 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

commit 3a4a1d297766c0617129fb9eeef164293926ae89
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 21 15:00:01 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 15:00:01 2013 +0100

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5256ca7..9cc31b4 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= f62079cd7de6ec37f48dfc80fb5906f49fecd6f6
-# Tue May 14 18:48:49 2013 +0100
-# piix4acpi, xen, hotplug: Fix race with ACPI AML code and hotplug.
+QEMU_TAG ?= 70992304dc8c5fc67d876e0f8e3dfaa82be955a1
+# Tue May 21 14:57:23 2013 +0100
+# Signed-off-by: Olaf Hering <olaf@aepfle.de>
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 04:34:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 04:34: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 1Uf0kf-0005bf-CO; Wed, 22 May 2013 04:34: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 1Uf0ke-0005az-42
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:12 +0000
Received: from [85.158.138.51:3640] by server-3.bemta-3.messagelabs.com id
	30/25-12734-3CA4C915; Wed, 22 May 2013 04:34:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1369197249!27936719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1680 invoked from network); 22 May 2013 04:34:10 -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;
	22 May 2013 04:34: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 1Uf0kb-0000zN-7c
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uf0kb-0002Rk-4K
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 04:34:09 +0000
Date: Wed, 22 May 2013 04:34:09 +0000
Message-Id: <E1Uf0kb-0002Rk-4K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] 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

commit 3a4a1d297766c0617129fb9eeef164293926ae89
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue May 21 15:00:01 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue May 21 15:00:01 2013 +0100

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5256ca7..9cc31b4 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= f62079cd7de6ec37f48dfc80fb5906f49fecd6f6
-# Tue May 14 18:48:49 2013 +0100
-# piix4acpi, xen, hotplug: Fix race with ACPI AML code and hotplug.
+QEMU_TAG ?= 70992304dc8c5fc67d876e0f8e3dfaa82be955a1
+# Tue May 21 14:57:23 2013 +0100
+# Signed-off-by: Olaf Hering <olaf@aepfle.de>
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 19:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 19:55: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 1UfF7v-00077D-8J; Wed, 22 May 2013 19:55:11 +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 1UfF7u-000778-Cy
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:10 +0000
Received: from [193.109.254.147:23332] by server-14.bemta-14.messagelabs.com
	id 7D/42-02181-D922D915; Wed, 22 May 2013 19:55:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1369252506!9698140!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8723 invoked from network); 22 May 2013 19:55:08 -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;
	22 May 2013 19:55: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 1UfF7o-0003ez-SL
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfF7n-0008HQ-O1
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:03 +0000
Date: Wed, 22 May 2013 19:55:03 +0000
Message-Id: <E1UfF7n-0008HQ-O1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Use explicit widths for MMIO
	read/write, and add 64bit variants
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fbf7a46dae7f18a313f9317bbf9afc2249941a95
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 22 15:25:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 22 15:25:37 2013 +0200

    x86: Use explicit widths for MMIO read/write, and add 64bit variants
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/io.h |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/include/asm-x86/io.h b/xen/include/asm-x86/io.h
index 122d0a1..b156f48 100644
--- a/xen/include/asm-x86/io.h
+++ b/xen/include/asm-x86/io.h
@@ -5,12 +5,14 @@
 #include <xen/types.h>
 #include <asm/page.h>
 
-#define readb(x) (*(volatile char *)(x))
-#define readw(x) (*(volatile short *)(x))
-#define readl(x) (*(volatile int *)(x))
-#define writeb(d,x) (*(volatile char *)(x) = (d))
-#define writew(d,x) (*(volatile short *)(x) = (d))
-#define writel(d,x) (*(volatile int *)(x) = (d))
+#define readb(x) (*(volatile uint8_t  *)(x))
+#define readw(x) (*(volatile uint16_t *)(x))
+#define readl(x) (*(volatile uint32_t *)(x))
+#define readq(x) (*(volatile uint64_t *)(x))
+#define writeb(d,x) (*(volatile uint8_t  *)(x) = (d))
+#define writew(d,x) (*(volatile uint16_t *)(x) = (d))
+#define writel(d,x) (*(volatile uint32_t *)(x) = (d))
+#define writeq(d,x) (*(volatile uint64_t *)(x) = (d))
 
 #define __OUT1(s,x) \
 static inline void out##s(unsigned x value, unsigned short port) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 19:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 19:55: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 1UfF7v-00077D-8J; Wed, 22 May 2013 19:55:11 +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 1UfF7u-000778-Cy
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:10 +0000
Received: from [193.109.254.147:23332] by server-14.bemta-14.messagelabs.com
	id 7D/42-02181-D922D915; Wed, 22 May 2013 19:55:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1369252506!9698140!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8723 invoked from network); 22 May 2013 19:55:08 -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;
	22 May 2013 19:55: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 1UfF7o-0003ez-SL
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfF7n-0008HQ-O1
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:03 +0000
Date: Wed, 22 May 2013 19:55:03 +0000
Message-Id: <E1UfF7n-0008HQ-O1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Use explicit widths for MMIO
	read/write, and add 64bit variants
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 fbf7a46dae7f18a313f9317bbf9afc2249941a95
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 22 15:25:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 22 15:25:37 2013 +0200

    x86: Use explicit widths for MMIO read/write, and add 64bit variants
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/io.h |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/include/asm-x86/io.h b/xen/include/asm-x86/io.h
index 122d0a1..b156f48 100644
--- a/xen/include/asm-x86/io.h
+++ b/xen/include/asm-x86/io.h
@@ -5,12 +5,14 @@
 #include <xen/types.h>
 #include <asm/page.h>
 
-#define readb(x) (*(volatile char *)(x))
-#define readw(x) (*(volatile short *)(x))
-#define readl(x) (*(volatile int *)(x))
-#define writeb(d,x) (*(volatile char *)(x) = (d))
-#define writew(d,x) (*(volatile short *)(x) = (d))
-#define writel(d,x) (*(volatile int *)(x) = (d))
+#define readb(x) (*(volatile uint8_t  *)(x))
+#define readw(x) (*(volatile uint16_t *)(x))
+#define readl(x) (*(volatile uint32_t *)(x))
+#define readq(x) (*(volatile uint64_t *)(x))
+#define writeb(d,x) (*(volatile uint8_t  *)(x) = (d))
+#define writew(d,x) (*(volatile uint16_t *)(x) = (d))
+#define writel(d,x) (*(volatile uint32_t *)(x) = (d))
+#define writeq(d,x) (*(volatile uint64_t *)(x) = (d))
 
 #define __OUT1(s,x) \
 static inline void out##s(unsigned x value, unsigned short port) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 19:55:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 19:55: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 1UfF84-00077k-BU; Wed, 22 May 2013 19:55:20 +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 1UfF82-00077c-Qy
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:19 +0000
Received: from [85.158.137.99:18749] by server-12.bemta-3.messagelabs.com id
	11/28-17342-5A22D915; Wed, 22 May 2013 19:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1369252515!12817380!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26599 invoked from network); 22 May 2013 19:55:16 -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;
	22 May 2013 19:55: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 1UfF7z-0003f5-5R
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfF7y-0008Ho-Vs
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:15 +0000
Date: Wed, 22 May 2013 19:55:14 +0000
Message-Id: <E1UfF7y-0008Ho-Vs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] AMD/iommu: SR56x0 Erratum 64 - Reset
	all head & tail pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6d243308e1d75f866679db226159c797d6c83aad
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 22 15:26:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 22 15:26:52 2013 +0200

    AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
    
    Reference at time of patch:
    http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf
    
    Erratum 64 states that the head and tail pointers for the Command buffer and
    Event log are only reset on a cold boot, not a warm boot.
    
    While the erratum is limited to systems using SR56xx chipsets (such as Family
    10h CPUs), resetting the pointers is a sensible action in all cases, including
    the PPR log for consistency.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_init.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index abb94ec..0bcf8d2 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -154,6 +154,11 @@ static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);
+    writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
@@ -182,6 +187,11 @@ static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+    writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
 }
 
 static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
@@ -210,6 +220,9 @@ static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_PPR_LOG_LENGTH_MASK,
                         IOMMU_PPR_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET);
+
+    writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);
+    writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET);
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 22 19:55:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 May 2013 19:55: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 1UfF84-00077k-BU; Wed, 22 May 2013 19:55:20 +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 1UfF82-00077c-Qy
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:19 +0000
Received: from [85.158.137.99:18749] by server-12.bemta-3.messagelabs.com id
	11/28-17342-5A22D915; Wed, 22 May 2013 19:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1369252515!12817380!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26599 invoked from network); 22 May 2013 19:55:16 -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;
	22 May 2013 19:55: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 1UfF7z-0003f5-5R
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfF7y-0008Ho-Vs
	for xen-changelog@lists.xensource.com; Wed, 22 May 2013 19:55:15 +0000
Date: Wed, 22 May 2013 19:55:14 +0000
Message-Id: <E1UfF7y-0008Ho-Vs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] AMD/iommu: SR56x0 Erratum 64 - Reset
	all head & tail pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 6d243308e1d75f866679db226159c797d6c83aad
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 22 15:26:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 22 15:26:52 2013 +0200

    AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
    
    Reference at time of patch:
    http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf
    
    Erratum 64 states that the head and tail pointers for the Command buffer and
    Event log are only reset on a cold boot, not a warm boot.
    
    While the erratum is limited to systems using SR56xx chipsets (such as Family
    10h CPUs), resetting the pointers is a sensible action in all cases, including
    the PPR log for consistency.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_init.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index abb94ec..0bcf8d2 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -154,6 +154,11 @@ static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);
+    writeq(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
@@ -182,6 +187,11 @@ static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+    writeq(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
 }
 
 static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
@@ -210,6 +220,9 @@ static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_PPR_LOG_LENGTH_MASK,
                         IOMMU_PPR_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET);
+
+    writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);
+    writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET);
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 23 07:44:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 07:44: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 1UfQC7-000569-HT; Thu, 23 May 2013 07:44: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 1UfQC6-000562-L2
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 07:44:14 +0000
Received: from [85.158.139.83:50389] by server-12.bemta-5.messagelabs.com id
	B9/7F-16465-DC8CD915; Thu, 23 May 2013 07:44:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1369295043!21426189!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12310 invoked from network); 23 May 2013 07:44:04 -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;
	23 May 2013 07:44: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 1UfQBv-0001mt-48
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 07:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfQBv-00008T-1M
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 07:44:03 +0000
Date: Thu, 23 May 2013 07:44:03 +0000
Message-Id: <E1UfQBv-00008T-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif: document
	feature-split-event-channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9204bc654562976c7cdebf21c6b5013f6e3057b3
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed May 22 16:44:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 22 16:44:45 2013 +0200

    netif: document feature-split-event-channel
    
    This is a new feature to separate TX and RX notification. Document it in
    canonical header for future reference.
    
    For reference implementation, please see Xen network driver in Linux kernel.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/include/public/io/netif.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 9664998..d477751 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -57,6 +57,18 @@
  */
 
 /*
+ * "feature-split-event-channels" is introduced to separate guest TX
+ * and RX notification. Backend either doesn't support this feature or
+ * advertises it via xenstore as 0 (disabled) or 1 (enabled).
+ *
+ * To make use of this feature, frontend should allocate two event
+ * channels for TX and RX, advertise them to backend as
+ * "event-channel-tx" and "event-channel-rx" respectively. If frontend
+ * doesn't want to use this feature, it just writes "event-channel"
+ * node as before.
+ */
+
+/*
  * This is the 'wire' format for packets:
  *  Request 1: netif_tx_request -- NETTXF_* (any flags)
  * [Request 2: netif_tx_extra]  (only if request 1 has NETTXF_extra_info)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 23 07:44:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 07:44: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 1UfQC7-000569-HT; Thu, 23 May 2013 07:44: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 1UfQC6-000562-L2
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 07:44:14 +0000
Received: from [85.158.139.83:50389] by server-12.bemta-5.messagelabs.com id
	B9/7F-16465-DC8CD915; Thu, 23 May 2013 07:44:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1369295043!21426189!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12310 invoked from network); 23 May 2013 07:44:04 -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;
	23 May 2013 07:44: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 1UfQBv-0001mt-48
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 07:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfQBv-00008T-1M
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 07:44:03 +0000
Date: Thu, 23 May 2013 07:44:03 +0000
Message-Id: <E1UfQBv-00008T-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif: document
	feature-split-event-channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9204bc654562976c7cdebf21c6b5013f6e3057b3
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed May 22 16:44:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 22 16:44:45 2013 +0200

    netif: document feature-split-event-channel
    
    This is a new feature to separate TX and RX notification. Document it in
    canonical header for future reference.
    
    For reference implementation, please see Xen network driver in Linux kernel.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/include/public/io/netif.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 9664998..d477751 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -57,6 +57,18 @@
  */
 
 /*
+ * "feature-split-event-channels" is introduced to separate guest TX
+ * and RX notification. Backend either doesn't support this feature or
+ * advertises it via xenstore as 0 (disabled) or 1 (enabled).
+ *
+ * To make use of this feature, frontend should allocate two event
+ * channels for TX and RX, advertise them to backend as
+ * "event-channel-tx" and "event-channel-rx" respectively. If frontend
+ * doesn't want to use this feature, it just writes "event-channel"
+ * node as before.
+ */
+
+/*
  * This is the 'wire' format for packets:
  *  Request 1: netif_tx_request -- NETTXF_* (any flags)
  * [Request 2: netif_tx_extra]  (only if request 1 has NETTXF_extra_info)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17: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 1UfZ2j-0000HE-PM; Thu, 23 May 2013 17:11:09 +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 1UfZ2i-0000H8-LE
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:08 +0000
Received: from [85.158.139.83:60796] by server-7.bemta-5.messagelabs.com id
	61/B3-12828-BAD4E915; Thu, 23 May 2013 17:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1369329065!24797840!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13056 invoked from network); 23 May 2013 17:11:06 -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;
	23 May 2013 17:11: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 1UfZ2e-0000Yp-PI
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ2d-0005rw-Mt
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:03 +0000
Date: Thu, 23 May 2013 17:11:03 +0000
Message-Id: <E1UfZ2d-0005rw-Mt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: allow
	VCPUOP_register_vcpu_info to work again on PVHVM 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

commit 9b3db6d948f33043049d78029ef99baf5855d69e
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu May 23 10:05:27 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:05:27 2013 +0200

    x86: allow VCPUOP_register_vcpu_info to work again on PVHVM guests
    
    For details on the hypercall please see commit
    c58ae69360ccf2495a19bf4ca107e21cf873c75b (VCPUOP_register_vcpu_info) and
    the c/s 23143 (git commit 6b063a4a6f44245a727aa04ef76408b2e00af9c7)
    (x86: move pv-only members of struct vcpu to struct pv_vcpu)
    that introduced the regression.
    
    The current code allows the PVHVM guest to make this hypercall.
    But for PVHVM guest it always returns -EINVAL (-22) for Xen 4.2
    and above. Xen 4.1 and earlier worked.
    
    The reason is that the check in map_vcpu_info would fail
    at:
    
      if ( v->arch.vcpu_info_mfn != INVALID_MFN )
    
    The reason is that the vcpu_info_mfn for PVHVM guests ends up by
    defualt with the value of zero (introduced by c/s 23143).
    
    The code in vcpu_initialise which initialized vcpu_info_mfn to a
    valid value (INVALID_MFN), would never be called for PVHVM:
    
        if ( is_hvm_domain(d) )
        {
            rc = hvm_vcpu_initialise(v);
            goto done;
        }
    
        v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
    
    while previously it would be:
    
         v->arch.vcpu_info_mfn = INVALID_MFN;
    
    [right at the start of the function in Xen 4.1]
    
    This fixes the problem with Linux advertising this error:
    register_vcpu_info failed: err=-22
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    
    x86: call unmap_vcpu_info() regardless of guest type
    
    This fixes a regression from 63753b3e ("x86: allow
    VCPUOP_register_vcpu_info to work again on PVHVM guests").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
    master commit: 63753b3e0dc56efb1acf94fa46f3fee7bc59281c
    master date: 2013-04-17 11:35:38 +0200
    master commit: 9626d1c1fafe2da5af6e59478c9e9db6d03144df
    master date: 2013-05-02 09:29:36 +0200
---
 xen/arch/x86/domain.c        |   17 +++++++++--------
 xen/include/asm-x86/domain.h |    6 +++---
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index f76b362..1d5bcb5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -429,13 +429,14 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
+    v->arch.vcpu_info_mfn = INVALID_MFN;
+
     if ( is_hvm_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
         goto done;
     }
 
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
 
     spin_lock_init(&v->arch.pv_vcpu.shadow_ldt_lock);
 
@@ -1084,14 +1085,14 @@ unmap_vcpu_info(struct vcpu *v)
 {
     unsigned long mfn;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn == INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn == INVALID_MFN )
         return;
 
-    mfn = v->arch.pv_vcpu.vcpu_info_mfn;
+    mfn = v->arch.vcpu_info_mfn;
     unmap_domain_page_global(v->vcpu_info);
 
     v->vcpu_info = &dummy_vcpu_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
+    v->arch.vcpu_info_mfn = INVALID_MFN;
 
     put_page_and_type(mfn_to_page(mfn));
 }
@@ -1114,7 +1115,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
         return -EINVAL;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn != INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn != INVALID_MFN )
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
@@ -1151,7 +1152,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     }
 
     v->vcpu_info = new_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = page_to_mfn(page);
+    v->arch.vcpu_info_mfn = page_to_mfn(page);
 
     /* Set new vcpu_info pointer /before/ setting pending flags. */
     wmb();
@@ -2098,6 +2099,8 @@ int domain_relinquish_resources(struct domain *d)
             ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
+
+            unmap_vcpu_info(v);
         }
 
         if ( !is_hvm_domain(d) )
@@ -2110,8 +2113,6 @@ int domain_relinquish_resources(struct domain *d)
                  * mappings.
                  */
                 destroy_gdt(v);
-
-                unmap_vcpu_info(v);
             }
 
             if ( d->arch.pv_domain.pirq_eoi_map != NULL )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 898f63a..a3235a5 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -420,9 +420,6 @@ struct pv_vcpu
     /* Current LDT details. */
     unsigned long shadow_ldt_mapcnt;
     spinlock_t shadow_ldt_lock;
-
-    /* Guest-specified relocation of vcpu_info. */
-    unsigned long vcpu_info_mfn;
 };
 
 struct arch_vcpu
@@ -495,6 +492,9 @@ struct arch_vcpu
     
     struct paging_vcpu paging;
 
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long vcpu_info_mfn;
+
 #ifdef CONFIG_X86_32
     /* map_domain_page() mapping cache. */
     struct mapcache_vcpu mapcache;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17: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 1UfZ2j-0000HE-PM; Thu, 23 May 2013 17:11:09 +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 1UfZ2i-0000H8-LE
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:08 +0000
Received: from [85.158.139.83:60796] by server-7.bemta-5.messagelabs.com id
	61/B3-12828-BAD4E915; Thu, 23 May 2013 17:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1369329065!24797840!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13056 invoked from network); 23 May 2013 17:11:06 -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;
	23 May 2013 17:11: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 1UfZ2e-0000Yp-PI
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ2d-0005rw-Mt
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:03 +0000
Date: Thu, 23 May 2013 17:11:03 +0000
Message-Id: <E1UfZ2d-0005rw-Mt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: allow
	VCPUOP_register_vcpu_info to work again on PVHVM 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

commit 9b3db6d948f33043049d78029ef99baf5855d69e
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu May 23 10:05:27 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:05:27 2013 +0200

    x86: allow VCPUOP_register_vcpu_info to work again on PVHVM guests
    
    For details on the hypercall please see commit
    c58ae69360ccf2495a19bf4ca107e21cf873c75b (VCPUOP_register_vcpu_info) and
    the c/s 23143 (git commit 6b063a4a6f44245a727aa04ef76408b2e00af9c7)
    (x86: move pv-only members of struct vcpu to struct pv_vcpu)
    that introduced the regression.
    
    The current code allows the PVHVM guest to make this hypercall.
    But for PVHVM guest it always returns -EINVAL (-22) for Xen 4.2
    and above. Xen 4.1 and earlier worked.
    
    The reason is that the check in map_vcpu_info would fail
    at:
    
      if ( v->arch.vcpu_info_mfn != INVALID_MFN )
    
    The reason is that the vcpu_info_mfn for PVHVM guests ends up by
    defualt with the value of zero (introduced by c/s 23143).
    
    The code in vcpu_initialise which initialized vcpu_info_mfn to a
    valid value (INVALID_MFN), would never be called for PVHVM:
    
        if ( is_hvm_domain(d) )
        {
            rc = hvm_vcpu_initialise(v);
            goto done;
        }
    
        v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
    
    while previously it would be:
    
         v->arch.vcpu_info_mfn = INVALID_MFN;
    
    [right at the start of the function in Xen 4.1]
    
    This fixes the problem with Linux advertising this error:
    register_vcpu_info failed: err=-22
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    
    x86: call unmap_vcpu_info() regardless of guest type
    
    This fixes a regression from 63753b3e ("x86: allow
    VCPUOP_register_vcpu_info to work again on PVHVM guests").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
    master commit: 63753b3e0dc56efb1acf94fa46f3fee7bc59281c
    master date: 2013-04-17 11:35:38 +0200
    master commit: 9626d1c1fafe2da5af6e59478c9e9db6d03144df
    master date: 2013-05-02 09:29:36 +0200
---
 xen/arch/x86/domain.c        |   17 +++++++++--------
 xen/include/asm-x86/domain.h |    6 +++---
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index f76b362..1d5bcb5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -429,13 +429,14 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
+    v->arch.vcpu_info_mfn = INVALID_MFN;
+
     if ( is_hvm_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
         goto done;
     }
 
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
 
     spin_lock_init(&v->arch.pv_vcpu.shadow_ldt_lock);
 
@@ -1084,14 +1085,14 @@ unmap_vcpu_info(struct vcpu *v)
 {
     unsigned long mfn;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn == INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn == INVALID_MFN )
         return;
 
-    mfn = v->arch.pv_vcpu.vcpu_info_mfn;
+    mfn = v->arch.vcpu_info_mfn;
     unmap_domain_page_global(v->vcpu_info);
 
     v->vcpu_info = &dummy_vcpu_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
+    v->arch.vcpu_info_mfn = INVALID_MFN;
 
     put_page_and_type(mfn_to_page(mfn));
 }
@@ -1114,7 +1115,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
         return -EINVAL;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn != INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn != INVALID_MFN )
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
@@ -1151,7 +1152,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     }
 
     v->vcpu_info = new_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = page_to_mfn(page);
+    v->arch.vcpu_info_mfn = page_to_mfn(page);
 
     /* Set new vcpu_info pointer /before/ setting pending flags. */
     wmb();
@@ -2098,6 +2099,8 @@ int domain_relinquish_resources(struct domain *d)
             ret = vcpu_destroy_pagetables(v);
             if ( ret )
                 return ret;
+
+            unmap_vcpu_info(v);
         }
 
         if ( !is_hvm_domain(d) )
@@ -2110,8 +2113,6 @@ int domain_relinquish_resources(struct domain *d)
                  * mappings.
                  */
                 destroy_gdt(v);
-
-                unmap_vcpu_info(v);
             }
 
             if ( d->arch.pv_domain.pirq_eoi_map != NULL )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 898f63a..a3235a5 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -420,9 +420,6 @@ struct pv_vcpu
     /* Current LDT details. */
     unsigned long shadow_ldt_mapcnt;
     spinlock_t shadow_ldt_lock;
-
-    /* Guest-specified relocation of vcpu_info. */
-    unsigned long vcpu_info_mfn;
 };
 
 struct arch_vcpu
@@ -495,6 +492,9 @@ struct arch_vcpu
     
     struct paging_vcpu paging;
 
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long vcpu_info_mfn;
+
 #ifdef CONFIG_X86_32
     /* map_domain_page() mapping cache. */
     struct mapcache_vcpu mapcache;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17: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 1UfZ2u-0000Ht-SG; Thu, 23 May 2013 17:11:20 +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 1UfZ2t-0000Hi-0S
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:19 +0000
Received: from [85.158.143.99:51445] by server-2.bemta-4.messagelabs.com id
	BF/14-27124-6BD4E915; Thu, 23 May 2013 17:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1369329076!23928394!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31516 invoked from network); 23 May 2013 17:11:17 -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;
	23 May 2013 17:11: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 1UfZ2q-0000Ys-Iy
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ2p-0005sq-IC
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:15 +0000
Date: Thu, 23 May 2013 17:11:15 +0000
Message-Id: <E1UfZ2p-0005sq-IC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ns16550: delay resume until dom0
	ACPI has a chance to run
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2dd5ee75cdc3101b7a90c8482a27d8cc990dd46d
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Thu May 23 10:06:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:06:34 2013 +0200

    ns16550: delay resume until dom0 ACPI has a chance to run
    
    Check for ioport access, before fully resuming operation, to avoid
    spinning in __ns16550_poll when reading the LSR register returns 0xFF
    on failing ioport access.
    
    On some systems (like Lenovo T410, and some HP machines of similar vintage)
    there is a SuperIO card that provides this legacy ioport on the LPC bus.
    
    In this case, we need to wait for dom0's ACPI processing to run the proper
    AML to re-initialize the chip, before we can use the card again.
    
    This may cause a small amount of garbage to be written to the serial log
    while we wait patiently for that AML to be executed.
    
    This implementation limits the number of retries, to avoid a situation
    where we keep trying over and over again, in the case of some other failure
    on the ioport.
    
    Signed-Off-By: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 6e96c186d23873597896051b043cfeb119c4a7d5
    master date: 2013-04-24 11:41:53 +0200
---
 xen/drivers/char/ns16550.c |   55 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index d77042e..12c5f84 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -42,6 +42,7 @@ static struct ns16550 {
     struct irqaction irqaction;
     /* UART with no IRQ line: periodically-polled I/O. */
     struct timer timer;
+    struct timer resume_timer;
     unsigned int timeout_ms;
     bool_t intr_works;
     /* PCI card parameters. */
@@ -120,6 +121,10 @@ static struct ns16550 {
 /* Frequency of external clock source. This definition assumes PC platform. */
 #define UART_CLOCK_HZ   1843200
 
+/* Resume retry settings */
+#define RESUME_DELAY    MILLISECS(10)
+#define RESUME_RETRIES  100
+
 static char ns_read_reg(struct ns16550 *uart, int reg)
 {
     if ( uart->remapped_io_base == NULL )
@@ -330,7 +335,7 @@ static void ns16550_suspend(struct serial_port *port)
                                   uart->ps_bdf[2], PCI_COMMAND);
 }
 
-static void ns16550_resume(struct serial_port *port)
+static void _ns16550_resume(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
 
@@ -346,6 +351,54 @@ static void ns16550_resume(struct serial_port *port)
     ns16550_setup_postirq(port->uart);
 }
 
+static int ns16550_ioport_invalid(struct ns16550 *uart)
+{
+    return ((((unsigned char)ns_read_reg(uart, LSR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, MCR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IER)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IIR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, LCR)) == 0xff));
+}
+
+static int delayed_resume_tries;
+static void ns16550_delayed_resume(void *data)
+{
+    struct serial_port *port = data;
+    struct ns16550 *uart = port->uart;
+
+    if ( ns16550_ioport_invalid(port->uart) && delayed_resume_tries-- )
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    else
+        _ns16550_resume(port);
+}
+
+static void ns16550_resume(struct serial_port *port)
+{
+    struct ns16550 *uart = port->uart;
+
+    /*
+     * Check for ioport access, before fully resuming operation.
+     * On some systems, there is a SuperIO card that provides
+     * this legacy ioport on the LPC bus.
+     *
+     * We need to wait for dom0's ACPI processing to run the proper
+     * AML to re-initialize the chip, before we can use the card again.
+     *
+     * This may cause a small amount of garbage to be written
+     * to the serial log while we wait patiently for that AML to
+     * be executed. However, this is preferable to spinning in an
+     * infinite loop, as seen on a Lenovo T430, when serial was enabled.
+     */
+    if ( ns16550_ioport_invalid(uart) )
+    {
+        delayed_resume_tries = RESUME_RETRIES;
+        init_timer(&uart->resume_timer, ns16550_delayed_resume, port, 0);
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    }
+    else
+        _ns16550_resume(port);
+}
+
 #ifdef CONFIG_X86
 static void __init ns16550_endboot(struct serial_port *port)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17: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 1UfZ2u-0000Ht-SG; Thu, 23 May 2013 17:11:20 +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 1UfZ2t-0000Hi-0S
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:19 +0000
Received: from [85.158.143.99:51445] by server-2.bemta-4.messagelabs.com id
	BF/14-27124-6BD4E915; Thu, 23 May 2013 17:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1369329076!23928394!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31516 invoked from network); 23 May 2013 17:11:17 -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;
	23 May 2013 17:11: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 1UfZ2q-0000Ys-Iy
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ2p-0005sq-IC
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:15 +0000
Date: Thu, 23 May 2013 17:11:15 +0000
Message-Id: <E1UfZ2p-0005sq-IC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ns16550: delay resume until dom0
	ACPI has a chance to run
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 2dd5ee75cdc3101b7a90c8482a27d8cc990dd46d
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Thu May 23 10:06:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:06:34 2013 +0200

    ns16550: delay resume until dom0 ACPI has a chance to run
    
    Check for ioport access, before fully resuming operation, to avoid
    spinning in __ns16550_poll when reading the LSR register returns 0xFF
    on failing ioport access.
    
    On some systems (like Lenovo T410, and some HP machines of similar vintage)
    there is a SuperIO card that provides this legacy ioport on the LPC bus.
    
    In this case, we need to wait for dom0's ACPI processing to run the proper
    AML to re-initialize the chip, before we can use the card again.
    
    This may cause a small amount of garbage to be written to the serial log
    while we wait patiently for that AML to be executed.
    
    This implementation limits the number of retries, to avoid a situation
    where we keep trying over and over again, in the case of some other failure
    on the ioport.
    
    Signed-Off-By: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 6e96c186d23873597896051b043cfeb119c4a7d5
    master date: 2013-04-24 11:41:53 +0200
---
 xen/drivers/char/ns16550.c |   55 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index d77042e..12c5f84 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -42,6 +42,7 @@ static struct ns16550 {
     struct irqaction irqaction;
     /* UART with no IRQ line: periodically-polled I/O. */
     struct timer timer;
+    struct timer resume_timer;
     unsigned int timeout_ms;
     bool_t intr_works;
     /* PCI card parameters. */
@@ -120,6 +121,10 @@ static struct ns16550 {
 /* Frequency of external clock source. This definition assumes PC platform. */
 #define UART_CLOCK_HZ   1843200
 
+/* Resume retry settings */
+#define RESUME_DELAY    MILLISECS(10)
+#define RESUME_RETRIES  100
+
 static char ns_read_reg(struct ns16550 *uart, int reg)
 {
     if ( uart->remapped_io_base == NULL )
@@ -330,7 +335,7 @@ static void ns16550_suspend(struct serial_port *port)
                                   uart->ps_bdf[2], PCI_COMMAND);
 }
 
-static void ns16550_resume(struct serial_port *port)
+static void _ns16550_resume(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
 
@@ -346,6 +351,54 @@ static void ns16550_resume(struct serial_port *port)
     ns16550_setup_postirq(port->uart);
 }
 
+static int ns16550_ioport_invalid(struct ns16550 *uart)
+{
+    return ((((unsigned char)ns_read_reg(uart, LSR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, MCR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IER)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IIR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, LCR)) == 0xff));
+}
+
+static int delayed_resume_tries;
+static void ns16550_delayed_resume(void *data)
+{
+    struct serial_port *port = data;
+    struct ns16550 *uart = port->uart;
+
+    if ( ns16550_ioport_invalid(port->uart) && delayed_resume_tries-- )
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    else
+        _ns16550_resume(port);
+}
+
+static void ns16550_resume(struct serial_port *port)
+{
+    struct ns16550 *uart = port->uart;
+
+    /*
+     * Check for ioport access, before fully resuming operation.
+     * On some systems, there is a SuperIO card that provides
+     * this legacy ioport on the LPC bus.
+     *
+     * We need to wait for dom0's ACPI processing to run the proper
+     * AML to re-initialize the chip, before we can use the card again.
+     *
+     * This may cause a small amount of garbage to be written
+     * to the serial log while we wait patiently for that AML to
+     * be executed. However, this is preferable to spinning in an
+     * infinite loop, as seen on a Lenovo T430, when serial was enabled.
+     */
+    if ( ns16550_ioport_invalid(uart) )
+    {
+        delayed_resume_tries = RESUME_RETRIES;
+        init_timer(&uart->resume_timer, ns16550_delayed_resume, port, 0);
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    }
+    else
+        _ns16550_resume(port);
+}
+
 #ifdef CONFIG_X86
 static void __init ns16550_endboot(struct serial_port *port)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:11: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 1UfZ34-0000Iq-VP; Thu, 23 May 2013 17:11:30 +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 1UfZ33-0000Ia-Lh
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:29 +0000
Received: from [85.158.137.99:33703] by server-4.bemta-3.messagelabs.com id
	89/6B-01776-0CD4E915; Thu, 23 May 2013 17:11:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1369329087!18100528!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26629 invoked from network); 23 May 2013 17:11:28 -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;
	23 May 2013 17:11: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 1UfZ30-0000Yy-PL
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ30-0005tD-NN
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:26 +0000
Date: Thu, 23 May 2013 17:11:26 +0000
Message-Id: <E1UfZ30-0005tD-NN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: handle paged gfn in
	wrmsr_hypervisor_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

commit 0b05309aa78ef834ece1b27866be279c9e184572
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu May 23 10:08:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:08:33 2013 +0200

    x86: handle paged gfn in wrmsr_hypervisor_regs
    
    If xenpaging is started very early for a guest the gfn for the hypercall
    page may be paged-out already. This leads to a guest crash:
    
    ...
    (XEN) HVM10: Allocated Xen hypercall page at 169ff000
    (XEN) traps.c:654:d10 Bad GMFN 169ff (MFN 3e900000000) to MSR 40000000
    (XEN) HVM10: Detected Xen v4.3
    (XEN) io.c:201:d10 MMIO emulation failed @ 0008:c2c2c2c2: 18 7c 55 6d 03 83 ff ff 10 7c
    (XEN) hvm.c:1253:d10 Triple fault on VCPU0 - invoking HVM shutdown action 1.
    (XEN) HVM11: HVM Loader
    ...
    
    Update return codes of wrmsr_hypervisor_regs, update callers to deal
    with the new return codes:
     0: not handled
     1: handled
     -EAGAIN: retry
    
    Currently wrmsr_hypervisor_regs will not return the following error, it
    will be added in a separate patch:
     -EINVAL: error during handling
    
    Also update the gdprintk to handle a page value of NULL to avoid
    printing a bogus MFN value. Update also computing of MSR value in
    gdprintk, the idx was always zero.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 013e34f5a61725012467f17650597d351fc0ca99
    master date: 2013-05-07 16:41:24 +0200
---
 xen/arch/x86/hvm/svm/svm.c |   16 +++++++++++++---
 xen/arch/x86/hvm/vmx/vmx.c |   11 ++++++++++-
 xen/arch/x86/traps.c       |   14 +++++++++++---
 3 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 7533bf3..1b00794 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1590,7 +1590,7 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 
 static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
 {
-    int ret;
+    int ret, result = X86EMUL_OKAY;
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     int sync = 0;
@@ -1703,14 +1703,24 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         if ( wrmsr_viridian_regs(msr, msr_content) )
             break;
 
-        wrmsr_hypervisor_regs(msr, msr_content);
+        switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+        {
+        case -EAGAIN:
+            result = X86EMUL_RETRY;
+            break;
+        case 0:
+        case 1:
+            break;
+        default:
+            goto gpf;
+        }
         break;
     }
 
     if ( sync )
         svm_vmload(vmcb);
 
-    return X86EMUL_OKAY;
+    return result;
 
  gpf:
     hvm_inject_hw_exception(TRAP_gp_fault, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 428a5c9..9ebb2af 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2058,7 +2058,16 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
             case HNDL_unhandled:
                 if ( (vmx_write_guest_msr(msr, msr_content) != 0) &&
                      !is_last_branch_msr(msr) )
-                    wrmsr_hypervisor_regs(msr, msr_content);
+                    switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+                    {
+                    case -EAGAIN:
+                        return X86EMUL_RETRY;
+                    case 0:
+                    case 1:
+                        break;
+                    default:
+                        goto gp_fault;
+                    }
                 break;
             case HNDL_exception_raised:
                 return X86EMUL_EXCEPTION;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index eada470..76378c6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -665,6 +665,7 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
         unsigned long gmfn = val >> 12;
         unsigned int idx  = val & 0xfff;
         struct page_info *page;
+        p2m_type_t t;
 
         if ( idx > 0 )
         {
@@ -674,15 +675,22 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
             return 0;
         }
 
-        page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
+        page = get_page_from_gfn(d, gmfn, &t, P2M_ALLOC);
 
         if ( !page || !get_page_type(page, PGT_writable_page) )
         {
             if ( page )
                 put_page(page);
+
+            if ( p2m_is_paging(t) )
+            {
+                p2m_mem_paging_populate(d, gmfn);
+                return -EAGAIN;
+            }
+
             gdprintk(XENLOG_WARNING,
                      "Bad GMFN %lx (MFN %lx) to MSR %08x\n",
-                     gmfn, page_to_mfn(page), base + idx);
+                     gmfn, page ? page_to_mfn(page) : -1UL, base);
             return 0;
         }
 
@@ -2579,7 +2587,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                 goto fail;
             break;
         default:
-            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) )
+            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) == 1 )
                 break;
 
             rc = vmce_wrmsr(regs->ecx, msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:11: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 1UfZ34-0000Iq-VP; Thu, 23 May 2013 17:11:30 +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 1UfZ33-0000Ia-Lh
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:29 +0000
Received: from [85.158.137.99:33703] by server-4.bemta-3.messagelabs.com id
	89/6B-01776-0CD4E915; Thu, 23 May 2013 17:11:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1369329087!18100528!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26629 invoked from network); 23 May 2013 17:11:28 -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;
	23 May 2013 17:11: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 1UfZ30-0000Yy-PL
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ30-0005tD-NN
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:26 +0000
Date: Thu, 23 May 2013 17:11:26 +0000
Message-Id: <E1UfZ30-0005tD-NN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: handle paged gfn in
	wrmsr_hypervisor_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

commit 0b05309aa78ef834ece1b27866be279c9e184572
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu May 23 10:08:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:08:33 2013 +0200

    x86: handle paged gfn in wrmsr_hypervisor_regs
    
    If xenpaging is started very early for a guest the gfn for the hypercall
    page may be paged-out already. This leads to a guest crash:
    
    ...
    (XEN) HVM10: Allocated Xen hypercall page at 169ff000
    (XEN) traps.c:654:d10 Bad GMFN 169ff (MFN 3e900000000) to MSR 40000000
    (XEN) HVM10: Detected Xen v4.3
    (XEN) io.c:201:d10 MMIO emulation failed @ 0008:c2c2c2c2: 18 7c 55 6d 03 83 ff ff 10 7c
    (XEN) hvm.c:1253:d10 Triple fault on VCPU0 - invoking HVM shutdown action 1.
    (XEN) HVM11: HVM Loader
    ...
    
    Update return codes of wrmsr_hypervisor_regs, update callers to deal
    with the new return codes:
     0: not handled
     1: handled
     -EAGAIN: retry
    
    Currently wrmsr_hypervisor_regs will not return the following error, it
    will be added in a separate patch:
     -EINVAL: error during handling
    
    Also update the gdprintk to handle a page value of NULL to avoid
    printing a bogus MFN value. Update also computing of MSR value in
    gdprintk, the idx was always zero.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 013e34f5a61725012467f17650597d351fc0ca99
    master date: 2013-05-07 16:41:24 +0200
---
 xen/arch/x86/hvm/svm/svm.c |   16 +++++++++++++---
 xen/arch/x86/hvm/vmx/vmx.c |   11 ++++++++++-
 xen/arch/x86/traps.c       |   14 +++++++++++---
 3 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 7533bf3..1b00794 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1590,7 +1590,7 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 
 static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
 {
-    int ret;
+    int ret, result = X86EMUL_OKAY;
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     int sync = 0;
@@ -1703,14 +1703,24 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         if ( wrmsr_viridian_regs(msr, msr_content) )
             break;
 
-        wrmsr_hypervisor_regs(msr, msr_content);
+        switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+        {
+        case -EAGAIN:
+            result = X86EMUL_RETRY;
+            break;
+        case 0:
+        case 1:
+            break;
+        default:
+            goto gpf;
+        }
         break;
     }
 
     if ( sync )
         svm_vmload(vmcb);
 
-    return X86EMUL_OKAY;
+    return result;
 
  gpf:
     hvm_inject_hw_exception(TRAP_gp_fault, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 428a5c9..9ebb2af 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2058,7 +2058,16 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
             case HNDL_unhandled:
                 if ( (vmx_write_guest_msr(msr, msr_content) != 0) &&
                      !is_last_branch_msr(msr) )
-                    wrmsr_hypervisor_regs(msr, msr_content);
+                    switch ( wrmsr_hypervisor_regs(msr, msr_content) )
+                    {
+                    case -EAGAIN:
+                        return X86EMUL_RETRY;
+                    case 0:
+                    case 1:
+                        break;
+                    default:
+                        goto gp_fault;
+                    }
                 break;
             case HNDL_exception_raised:
                 return X86EMUL_EXCEPTION;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index eada470..76378c6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -665,6 +665,7 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
         unsigned long gmfn = val >> 12;
         unsigned int idx  = val & 0xfff;
         struct page_info *page;
+        p2m_type_t t;
 
         if ( idx > 0 )
         {
@@ -674,15 +675,22 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
             return 0;
         }
 
-        page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
+        page = get_page_from_gfn(d, gmfn, &t, P2M_ALLOC);
 
         if ( !page || !get_page_type(page, PGT_writable_page) )
         {
             if ( page )
                 put_page(page);
+
+            if ( p2m_is_paging(t) )
+            {
+                p2m_mem_paging_populate(d, gmfn);
+                return -EAGAIN;
+            }
+
             gdprintk(XENLOG_WARNING,
                      "Bad GMFN %lx (MFN %lx) to MSR %08x\n",
-                     gmfn, page_to_mfn(page), base + idx);
+                     gmfn, page ? page_to_mfn(page) : -1UL, base);
             return 0;
         }
 
@@ -2579,7 +2587,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                 goto fail;
             break;
         default:
-            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) )
+            if ( wrmsr_hypervisor_regs(regs->ecx, msr_content) == 1 )
                 break;
 
             rc = vmce_wrmsr(regs->ecx, msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17: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 1UfZ3H-0000Ke-28; Thu, 23 May 2013 17:11: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 1UfZ3F-0000KM-Np
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:41 +0000
Received: from [193.109.254.147:22583] by server-8.bemta-14.messagelabs.com id
	0B/E4-04364-DCD4E915; Thu, 23 May 2013 17:11:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1369329097!8771811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15312 invoked from network); 23 May 2013 17:11:38 -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;
	23 May 2013 17:11: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 1UfZ3A-0000Z6-V5
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3A-0005tl-Sw
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:36 +0000
Date: Thu, 23 May 2013 17:11:36 +0000
Message-Id: <E1UfZ3A-0005tl-Sw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/IO-APIC: fix guest RTE write
	corner cases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0cda713442ada58aa2242d1df6af6b4fe925d212
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:09:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:09:17 2013 +0200

    x86/IO-APIC: fix guest RTE write corner cases
    
    This fixes two regressions from c/s 20143:a7de5bd776ca ("x86: Make the
    hypercall PHYSDEVOP_alloc_irq_vector hypercall dummy"):
    
    For one, IRQs that had their vector set up by Xen internally without a
    handler ever having got set (e.g. via "com<n>=..." without a matching
    consumer option like "console=com<n>") would wrongly call
    add_pin_to_irq() here, triggering the BUG_ON() in that function.
    
    Second, when assign_irq_vector() fails this addition to irq_2_pin[]
    needs to be undone.
    
    In the context of this I'm also surprised that the irq_2_pin[]
    manipulations here occur without any lock, i.e. rely on Dom0 to do
    some sort of serialization.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 30256a0ff17f6f3b1278b85103187341d5b0ac42
    master date: 2013-05-15 10:52:02 +0200
---
 xen/arch/x86/io_apic.c |   57 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 953d1c6..c06602e 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -141,6 +141,37 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin)
     share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
+static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
+{
+    struct irq_pin_list *entry, *prev;
+
+    for (entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next]) {
+        if ((entry->apic == apic) && (entry->pin == pin))
+            break;
+        BUG_ON(!entry->next);
+    }
+
+    entry->pin = entry->apic = -1;
+
+    if (entry != &irq_2_pin[irq]) {
+        /* Removed entry is not at head of list. */
+        prev = &irq_2_pin[irq];
+        while (&irq_2_pin[prev->next] != entry)
+            prev = &irq_2_pin[prev->next];
+        prev->next = entry->next;
+    } else if (entry->next) {
+        /* Removed entry is at head of multi-item list. */
+        prev  = entry;
+        entry = &irq_2_pin[entry->next];
+        *prev = *entry;
+        entry->pin = entry->apic = -1;
+    } else
+        return;
+
+    entry->next = irq_2_pin_free_entry;
+    irq_2_pin_free_entry = entry - irq_2_pin;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -2292,7 +2323,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
-    int apic, pin, irq, ret, vector, pirq;
+    int apic, pin, irq, ret, pirq;
     struct IO_APIC_route_entry rte = { 0 };
     unsigned long flags;
     struct irq_desc *desc;
@@ -2360,13 +2391,25 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         return 0;
     }
 
-    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ) {
-        add_pin_to_irq(irq, apic, pin);
-        vector = assign_irq_vector(irq, NULL);
-        if ( vector < 0 )
-            return vector;
+    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR )
+    {
+        int vector = desc->arch.vector;
+
+        if ( vector < FIRST_HIPRIORITY_VECTOR )
+            add_pin_to_irq(irq, apic, pin);
+        else
+            desc->arch.vector = IRQ_VECTOR_UNASSIGNED;
+        ret = assign_irq_vector(irq, NULL);
+        if ( ret < 0 )
+        {
+            if ( vector < FIRST_HIPRIORITY_VECTOR )
+                remove_pin_from_irq(irq, apic, pin);
+            else
+                desc->arch.vector = vector;
+            return ret;
+        }
 
-        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
     spin_lock(&dom0->event_lock);
     ret = map_domain_pirq(dom0, pirq, irq,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:11:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17: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 1UfZ3H-0000Ke-28; Thu, 23 May 2013 17:11: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 1UfZ3F-0000KM-Np
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:41 +0000
Received: from [193.109.254.147:22583] by server-8.bemta-14.messagelabs.com id
	0B/E4-04364-DCD4E915; Thu, 23 May 2013 17:11:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1369329097!8771811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15312 invoked from network); 23 May 2013 17:11:38 -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;
	23 May 2013 17:11: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 1UfZ3A-0000Z6-V5
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3A-0005tl-Sw
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:36 +0000
Date: Thu, 23 May 2013 17:11:36 +0000
Message-Id: <E1UfZ3A-0005tl-Sw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/IO-APIC: fix guest RTE write
	corner cases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0cda713442ada58aa2242d1df6af6b4fe925d212
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:09:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:09:17 2013 +0200

    x86/IO-APIC: fix guest RTE write corner cases
    
    This fixes two regressions from c/s 20143:a7de5bd776ca ("x86: Make the
    hypercall PHYSDEVOP_alloc_irq_vector hypercall dummy"):
    
    For one, IRQs that had their vector set up by Xen internally without a
    handler ever having got set (e.g. via "com<n>=..." without a matching
    consumer option like "console=com<n>") would wrongly call
    add_pin_to_irq() here, triggering the BUG_ON() in that function.
    
    Second, when assign_irq_vector() fails this addition to irq_2_pin[]
    needs to be undone.
    
    In the context of this I'm also surprised that the irq_2_pin[]
    manipulations here occur without any lock, i.e. rely on Dom0 to do
    some sort of serialization.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 30256a0ff17f6f3b1278b85103187341d5b0ac42
    master date: 2013-05-15 10:52:02 +0200
---
 xen/arch/x86/io_apic.c |   57 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 953d1c6..c06602e 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -141,6 +141,37 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin)
     share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
+static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
+{
+    struct irq_pin_list *entry, *prev;
+
+    for (entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next]) {
+        if ((entry->apic == apic) && (entry->pin == pin))
+            break;
+        BUG_ON(!entry->next);
+    }
+
+    entry->pin = entry->apic = -1;
+
+    if (entry != &irq_2_pin[irq]) {
+        /* Removed entry is not at head of list. */
+        prev = &irq_2_pin[irq];
+        while (&irq_2_pin[prev->next] != entry)
+            prev = &irq_2_pin[prev->next];
+        prev->next = entry->next;
+    } else if (entry->next) {
+        /* Removed entry is at head of multi-item list. */
+        prev  = entry;
+        entry = &irq_2_pin[entry->next];
+        *prev = *entry;
+        entry->pin = entry->apic = -1;
+    } else
+        return;
+
+    entry->next = irq_2_pin_free_entry;
+    irq_2_pin_free_entry = entry - irq_2_pin;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -2292,7 +2323,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
-    int apic, pin, irq, ret, vector, pirq;
+    int apic, pin, irq, ret, pirq;
     struct IO_APIC_route_entry rte = { 0 };
     unsigned long flags;
     struct irq_desc *desc;
@@ -2360,13 +2391,25 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         return 0;
     }
 
-    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ) {
-        add_pin_to_irq(irq, apic, pin);
-        vector = assign_irq_vector(irq, NULL);
-        if ( vector < 0 )
-            return vector;
+    if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR )
+    {
+        int vector = desc->arch.vector;
+
+        if ( vector < FIRST_HIPRIORITY_VECTOR )
+            add_pin_to_irq(irq, apic, pin);
+        else
+            desc->arch.vector = IRQ_VECTOR_UNASSIGNED;
+        ret = assign_irq_vector(irq, NULL);
+        if ( ret < 0 )
+        {
+            if ( vector < FIRST_HIPRIORITY_VECTOR )
+                remove_pin_from_irq(irq, apic, pin);
+            else
+                desc->arch.vector = vector;
+            return ret;
+        }
 
-        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
     spin_lock(&dom0->event_lock);
     ret = map_domain_pirq(dom0, pirq, irq,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ3c-0000NQ-Fw; Thu, 23 May 2013 17:12:04 +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 1UfZ3Y-0000N7-2k
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:00 +0000
Received: from [85.158.138.51:32184] by server-6.bemta-3.messagelabs.com id
	DE/33-14331-FDD4E915; Thu, 23 May 2013 17:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1369329117!28284359!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4190 invoked from network); 23 May 2013 17:11:58 -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;
	23 May 2013 17:11: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 1UfZ3V-0000ZO-B0
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3V-0005uW-9c
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:57 +0000
Date: Thu, 23 May 2013 17:11:57 +0000
Message-Id: <E1UfZ3V-0005uW-9c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/hvm: avoid p2m lookups for
	vlapic 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

commit 01d2cbf3877065058d1a60d1cb4f148398af10cb
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu May 23 10:11:12 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:11:12 2013 +0200

    x86/hvm: avoid p2m lookups for vlapic accesses.
    
    The LAPIC base address is a known GFN, so we can skip looking up the
    p2m: we know it should be handled as emulated MMIO.  That helps
    performance in older Windows OSes, which make a _lot_ of TPR accesses.
    
    This will change the behaviour of any OS that maps other
    memory/devices at its LAPIC address; the new behaviour (the LAPIC
    mapping always wins) is closer to actual hardware behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d43891bf4002b754cd90d83e91d9190e8c8b9d0
    master date: 2013-05-16 12:05:25 +0100
---
 xen/arch/x86/hvm/hvm.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index efacc98..6b82997 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1303,6 +1303,17 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
         }
     }
 
+    /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+     * a fast path for LAPIC accesses, skipping the p2m lookup. */
+    if ( !nestedhvm_vcpu_in_guestmode(v)
+         && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(v))) )
+    {
+        if ( !handle_mmio() )
+            hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        rc = 1;
+        goto out;
+    }
+
     p2m = p2m_get_hostp2m(v->domain);
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
                               P2M_ALLOC | (access_w ? P2M_UNSHARE : 0), NULL);
@@ -2403,6 +2414,12 @@ static enum hvm_copy_result __hvm_copy(
             gfn = addr >> PAGE_SHIFT;
         }
 
+        /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+         * a fast path for LAPIC accesses, skipping the p2m lookup. */
+        if ( !nestedhvm_vcpu_in_guestmode(curr)
+             && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(curr))) )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
         if ( p2m_is_paging(p2mt) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ3c-0000NQ-Fw; Thu, 23 May 2013 17:12:04 +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 1UfZ3Y-0000N7-2k
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:00 +0000
Received: from [85.158.138.51:32184] by server-6.bemta-3.messagelabs.com id
	DE/33-14331-FDD4E915; Thu, 23 May 2013 17:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1369329117!28284359!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4190 invoked from network); 23 May 2013 17:11:58 -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;
	23 May 2013 17:11: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 1UfZ3V-0000ZO-B0
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3V-0005uW-9c
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:57 +0000
Date: Thu, 23 May 2013 17:11:57 +0000
Message-Id: <E1UfZ3V-0005uW-9c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/hvm: avoid p2m lookups for
	vlapic 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

commit 01d2cbf3877065058d1a60d1cb4f148398af10cb
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu May 23 10:11:12 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:11:12 2013 +0200

    x86/hvm: avoid p2m lookups for vlapic accesses.
    
    The LAPIC base address is a known GFN, so we can skip looking up the
    p2m: we know it should be handled as emulated MMIO.  That helps
    performance in older Windows OSes, which make a _lot_ of TPR accesses.
    
    This will change the behaviour of any OS that maps other
    memory/devices at its LAPIC address; the new behaviour (the LAPIC
    mapping always wins) is closer to actual hardware behaviour.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5d43891bf4002b754cd90d83e91d9190e8c8b9d0
    master date: 2013-05-16 12:05:25 +0100
---
 xen/arch/x86/hvm/hvm.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index efacc98..6b82997 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1303,6 +1303,17 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
         }
     }
 
+    /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+     * a fast path for LAPIC accesses, skipping the p2m lookup. */
+    if ( !nestedhvm_vcpu_in_guestmode(v)
+         && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(v))) )
+    {
+        if ( !handle_mmio() )
+            hvm_inject_hw_exception(TRAP_gp_fault, 0);
+        rc = 1;
+        goto out;
+    }
+
     p2m = p2m_get_hostp2m(v->domain);
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
                               P2M_ALLOC | (access_w ? P2M_UNSHARE : 0), NULL);
@@ -2403,6 +2414,12 @@ static enum hvm_copy_result __hvm_copy(
             gfn = addr >> PAGE_SHIFT;
         }
 
+        /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs,
+         * a fast path for LAPIC accesses, skipping the p2m lookup. */
+        if ( !nestedhvm_vcpu_in_guestmode(curr)
+             && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(curr))) )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
         if ( p2m_is_paging(p2mt) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UfZ3c-0000Ng-Js; Thu, 23 May 2013 17:12:04 +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 1UfZ3Y-0000N9-B0
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:00 +0000
Received: from [193.109.254.147:10829] by server-9.bemta-14.messagelabs.com id
	FD/84-15694-FDD4E915; Thu, 23 May 2013 17:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1369329107!3759035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29470 invoked from network); 23 May 2013 17:11:48 -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;
	23 May 2013 17:11: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 1UfZ3L-0000ZC-5V
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3L-0005u7-3G
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:47 +0000
Date: Thu, 23 May 2013 17:11:47 +0000
Message-Id: <E1UfZ3L-0005u7-3G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/shadow: fix off-by-one in MMIO
	permission check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 927fcee39803c4134d82d03d410bf90d76457d90
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:10:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:10:08 2013 +0200

    x86/shadow: fix off-by-one in MMIO permission check
    
    iomem_access_permitted() wants an inclusive range as input.
    
    Also use pfn_to_paddr() in nearby code instead of open coding it.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: afa65ddfd88184a894d9364bec587554c28c20e0
    master date: 2013-05-15 14:34:05 +0200
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index ca4a241..08a86a5 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -603,13 +603,13 @@ _sh_propagate(struct vcpu *v,
         else if ( d->arch.hvm_domain.is_in_uc_mode )
             sflags |= pat_type_2_pte_flags(PAT_TYPE_UNCACHABLE);
         else
-            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn) + 1) )
+            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn)) )
             {
                 if ( p2mt == p2m_mmio_direct )
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             MTRR_TYPE_UNCACHABLE); 
                 else if ( iommu_snoop )
                     sflags |= pat_type_2_pte_flags(PAT_TYPE_WRBACK);
@@ -617,7 +617,7 @@ _sh_propagate(struct vcpu *v,
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             NO_HARDCODE_MEM_TYPE);
             }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UfZ3c-0000Ng-Js; Thu, 23 May 2013 17:12:04 +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 1UfZ3Y-0000N9-B0
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:00 +0000
Received: from [193.109.254.147:10829] by server-9.bemta-14.messagelabs.com id
	FD/84-15694-FDD4E915; Thu, 23 May 2013 17:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1369329107!3759035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29470 invoked from network); 23 May 2013 17:11:48 -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;
	23 May 2013 17:11: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 1UfZ3L-0000ZC-5V
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3L-0005u7-3G
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:11:47 +0000
Date: Thu, 23 May 2013 17:11:47 +0000
Message-Id: <E1UfZ3L-0005u7-3G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/shadow: fix off-by-one in MMIO
	permission check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 927fcee39803c4134d82d03d410bf90d76457d90
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:10:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:10:08 2013 +0200

    x86/shadow: fix off-by-one in MMIO permission check
    
    iomem_access_permitted() wants an inclusive range as input.
    
    Also use pfn_to_paddr() in nearby code instead of open coding it.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: afa65ddfd88184a894d9364bec587554c28c20e0
    master date: 2013-05-15 14:34:05 +0200
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index ca4a241..08a86a5 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -603,13 +603,13 @@ _sh_propagate(struct vcpu *v,
         else if ( d->arch.hvm_domain.is_in_uc_mode )
             sflags |= pat_type_2_pte_flags(PAT_TYPE_UNCACHABLE);
         else
-            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn) + 1) )
+            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn)) )
             {
                 if ( p2mt == p2m_mmio_direct )
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             MTRR_TYPE_UNCACHABLE); 
                 else if ( iommu_snoop )
                     sflags |= pat_type_2_pte_flags(PAT_TYPE_WRBACK);
@@ -617,7 +617,7 @@ _sh_propagate(struct vcpu *v,
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             NO_HARDCODE_MEM_TYPE);
             }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ3j-0000PR-PL; Thu, 23 May 2013 17:12:11 +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 1UfZ3i-0000PA-98
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:10 +0000
Received: from [85.158.139.211:17743] by server-7.bemta-5.messagelabs.com id
	A7/15-12828-9ED4E915; Thu, 23 May 2013 17:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1369329127!19313959!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21729 invoked from network); 23 May 2013 17:12:08 -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;
	23 May 2013 17:12: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 1UfZ3f-0000Zu-Ff
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3f-0005ut-EZ
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:07 +0000
Date: Thu, 23 May 2013 17:12:07 +0000
Message-Id: <E1UfZ3f-0005ut-EZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] fix XSA-46 regression with xend/xm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c298f7ec04fb474abdffa360e352be275a024467
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:13:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:13:18 2013 +0200

    fix XSA-46 regression with xend/xm
    
    The hypervisor side changes for XSA-46 require the tool stack to now
    always map the guest pIRQ before granting access permission to the
    underlying host IRQ (GSI). This in particular requires that pciif.py
    no longer can skip this step (assuming qemu would do it) for HVM
    guests.
    
    This in turn exposes, however, an inconsistency between xend and qemu:
    The former wants to always establish 1:1 mappings between pIRQ and host
    IRQ (for non-MSI only of course), while the latter always wants to
    allocate an arbitrary mapping. Since the whole tool stack obviously
    should always agree on the mapping model, make libxc enforce the 1:1
    mapping as the more natural one (as well as being the one that allows
    for easier debugging, since there no need to find out the extra
    mapping). Users of libxc that want to establish a particular (rather
    than an allocated) mapping are still free to do so, as well as tool
    stacks not based on libxc wanting to implement an allocation based
    model (which is why it's not the hypervisor that's being changed to
    enforce either model).
    
    Since libxl, like xend, already uses a 1:1 model, it's unaffected by
    the libxc change (and it being unaffected by the original hypervisor
    side changes is - afaict - simply due to qemu getting spawned at a
    later point in time compared to the xend event flow).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
    Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 934a5253d932b6f67fe40fc48975a2b0117e4cce
    master date: 2013-05-21 11:32:34 +0200
---
 tools/libxc/xc_physdev.c              |    2 +-
 tools/python/xen/xend/server/pciif.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index bdbcba7..cf02d85 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
     map.domid = domid;
     map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
-    map.pirq = *pirq;
+    map.pirq = *pirq < 0 ? index : *pirq;
 
     rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
 
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
index 43d0c80..27c1b75 100644
--- a/tools/python/xen/xend/server/pciif.py
+++ b/tools/python/xen/xend/server/pciif.py
@@ -340,7 +340,7 @@ class PciController(DevController):
                 raise VmError(('pci: failed to configure I/O memory on device '+
                             '%s - errno=%d')%(dev.name,rc))
 
-        if not self.vm.info.is_hvm() and dev.irq:
+        if dev.irq > 0:
             rc = xc.physdev_map_pirq(domid = fe_domid,
                                    index = dev.irq,
                                    pirq  = dev.irq)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ3j-0000PR-PL; Thu, 23 May 2013 17:12:11 +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 1UfZ3i-0000PA-98
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:10 +0000
Received: from [85.158.139.211:17743] by server-7.bemta-5.messagelabs.com id
	A7/15-12828-9ED4E915; Thu, 23 May 2013 17:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1369329127!19313959!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21729 invoked from network); 23 May 2013 17:12:08 -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;
	23 May 2013 17:12: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 1UfZ3f-0000Zu-Ff
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3f-0005ut-EZ
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:07 +0000
Date: Thu, 23 May 2013 17:12:07 +0000
Message-Id: <E1UfZ3f-0005ut-EZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] fix XSA-46 regression with xend/xm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 c298f7ec04fb474abdffa360e352be275a024467
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:13:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:13:18 2013 +0200

    fix XSA-46 regression with xend/xm
    
    The hypervisor side changes for XSA-46 require the tool stack to now
    always map the guest pIRQ before granting access permission to the
    underlying host IRQ (GSI). This in particular requires that pciif.py
    no longer can skip this step (assuming qemu would do it) for HVM
    guests.
    
    This in turn exposes, however, an inconsistency between xend and qemu:
    The former wants to always establish 1:1 mappings between pIRQ and host
    IRQ (for non-MSI only of course), while the latter always wants to
    allocate an arbitrary mapping. Since the whole tool stack obviously
    should always agree on the mapping model, make libxc enforce the 1:1
    mapping as the more natural one (as well as being the one that allows
    for easier debugging, since there no need to find out the extra
    mapping). Users of libxc that want to establish a particular (rather
    than an allocated) mapping are still free to do so, as well as tool
    stacks not based on libxc wanting to implement an allocation based
    model (which is why it's not the hypervisor that's being changed to
    enforce either model).
    
    Since libxl, like xend, already uses a 1:1 model, it's unaffected by
    the libxc change (and it being unaffected by the original hypervisor
    side changes is - afaict - simply due to qemu getting spawned at a
    later point in time compared to the xend event flow).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
    Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 934a5253d932b6f67fe40fc48975a2b0117e4cce
    master date: 2013-05-21 11:32:34 +0200
---
 tools/libxc/xc_physdev.c              |    2 +-
 tools/python/xen/xend/server/pciif.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index bdbcba7..cf02d85 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
     map.domid = domid;
     map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
-    map.pirq = *pirq;
+    map.pirq = *pirq < 0 ? index : *pirq;
 
     rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
 
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
index 43d0c80..27c1b75 100644
--- a/tools/python/xen/xend/server/pciif.py
+++ b/tools/python/xen/xend/server/pciif.py
@@ -340,7 +340,7 @@ class PciController(DevController):
                 raise VmError(('pci: failed to configure I/O memory on device '+
                             '%s - errno=%d')%(dev.name,rc))
 
-        if not self.vm.info.is_hvm() and dev.irq:
+        if dev.irq > 0:
             rc = xc.physdev_map_pirq(domid = fe_domid,
                                    index = dev.irq,
                                    pirq  = dev.irq)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ3z-0000SR-SR; Thu, 23 May 2013 17:12: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 1UfZ3y-0000S8-2Z
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:26 +0000
Received: from [193.109.254.147:23824] by server-3.bemta-14.messagelabs.com id
	91/73-06484-9FD4E915; Thu, 23 May 2013 17:12:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1369329137!8509287!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24968 invoked from network); 23 May 2013 17:12:18 -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;
	23 May 2013 17:12: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 1UfZ3p-0000a6-LH
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3p-0005w0-Jc
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:17 +0000
Date: Thu, 23 May 2013 17:12:17 +0000
Message-Id: <E1UfZ3p-0005w0-Jc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: fix dependency file
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3ef9022508e6e331e1bedb173a0aad509ceb69aa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:15:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:15:55 2013 +0200

    tools: fix dependency file generation
    
    There is a small set of places where files in subdirectories get
    compiled from the parent directory. Dependency file wise this is no
    problem as long as the files use names distinct without regard to the
    directories they sit in, and tools/console/ violates this (in having
    two main.c files). Hence we need to avoid losing the directory name,
    both to ensure the two compiler instances don't simultaneously write
    to the same file (happening of which is what triggered me looking
    into this) and to guarantee dependencies for all files will be seen
    by make on an incremental rebuild.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 4d788e164d6556d931bc3e0a69e36b8cf7280794
    master date: 2013-05-21 10:16:30 +0200
---
 tools/Rules.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index f4e84c1..e83f682 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -62,7 +62,7 @@ SHLIB_libxenlight  = -Wl,-rpath-link=$(XEN_XENLIGHT)
 CFLAGS += -D__XEN_TOOLS__
 
 # Get gcc to generate the dependencies for us.
-CFLAGS += -MMD -MF .$(@F).d
+CFLAGS += -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
 DEPS = .*.d
 
 ifneq ($(XEN_OS),NetBSD)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ3z-0000SR-SR; Thu, 23 May 2013 17:12: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 1UfZ3y-0000S8-2Z
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:26 +0000
Received: from [193.109.254.147:23824] by server-3.bemta-14.messagelabs.com id
	91/73-06484-9FD4E915; Thu, 23 May 2013 17:12:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1369329137!8509287!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24968 invoked from network); 23 May 2013 17:12:18 -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;
	23 May 2013 17:12: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 1UfZ3p-0000a6-LH
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3p-0005w0-Jc
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:17 +0000
Date: Thu, 23 May 2013 17:12:17 +0000
Message-Id: <E1UfZ3p-0005w0-Jc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: fix dependency file
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 3ef9022508e6e331e1bedb173a0aad509ceb69aa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 10:15:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:15:55 2013 +0200

    tools: fix dependency file generation
    
    There is a small set of places where files in subdirectories get
    compiled from the parent directory. Dependency file wise this is no
    problem as long as the files use names distinct without regard to the
    directories they sit in, and tools/console/ violates this (in having
    two main.c files). Hence we need to avoid losing the directory name,
    both to ensure the two compiler instances don't simultaneously write
    to the same file (happening of which is what triggered me looking
    into this) and to guarantee dependencies for all files will be seen
    by make on an incremental rebuild.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 4d788e164d6556d931bc3e0a69e36b8cf7280794
    master date: 2013-05-21 10:16:30 +0200
---
 tools/Rules.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index f4e84c1..e83f682 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -62,7 +62,7 @@ SHLIB_libxenlight  = -Wl,-rpath-link=$(XEN_XENLIGHT)
 CFLAGS += -D__XEN_TOOLS__
 
 # Get gcc to generate the dependencies for us.
-CFLAGS += -MMD -MF .$(@F).d
+CFLAGS += -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
 DEPS = .*.d
 
 ifneq ($(XEN_OS),NetBSD)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ43-0000TW-VD; Thu, 23 May 2013 17:12: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 1UfZ42-0000T9-Ht
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:30 +0000
Received: from [85.158.137.99:51652] by server-6.bemta-3.messagelabs.com id
	95/C3-14331-DFD4E915; Thu, 23 May 2013 17:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1369329148!15775125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23679 invoked from network); 23 May 2013 17:12:29 -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;
	23 May 2013 17:12: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 1UfZ3z-0000a9-RE
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3z-0005wM-Pl
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:27 +0000
Date: Thu, 23 May 2013 17:12:27 +0000
Message-Id: <E1UfZ3z-0005wM-Pl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD/iommu: SR56x0 Erratum 64 -
	Reset all head & tail pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 5ea99fa5355c9bb768388b7cf86950fd808ab2d3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu May 23 10:16:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:16:28 2013 +0200

    AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
    
    Reference at time of patch:
    http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf
    
    Erratum 64 states that the head and tail pointers for the Command buffer and
    Event log are only reset on a cold boot, not a warm boot.
    
    While the erratum is limited to systems using SR56xx chipsets (such as Family
    10h CPUs), resetting the pointers is a sensible action in all cases, including
    the PPR log for consistency.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6d243308e1d75f866679db226159c797d6c83aad
    master date: 2013-05-22 15:26:52 +0200
---
 xen/drivers/passthrough/amd/iommu_init.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index ebf964c..d876972 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -154,6 +154,11 @@ static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
@@ -182,6 +187,11 @@ static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
 }
 
 static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
@@ -210,6 +220,9 @@ static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_PPR_LOG_LENGTH_MASK,
                         IOMMU_PPR_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET);
+
+    writel(0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET);
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 17:12:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 17:12: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 1UfZ43-0000TW-VD; Thu, 23 May 2013 17:12: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 1UfZ42-0000T9-Ht
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:30 +0000
Received: from [85.158.137.99:51652] by server-6.bemta-3.messagelabs.com id
	95/C3-14331-DFD4E915; Thu, 23 May 2013 17:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1369329148!15775125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23679 invoked from network); 23 May 2013 17:12:29 -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;
	23 May 2013 17:12: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 1UfZ3z-0000a9-RE
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UfZ3z-0005wM-Pl
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 17:12:27 +0000
Date: Thu, 23 May 2013 17:12:27 +0000
Message-Id: <E1UfZ3z-0005wM-Pl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD/iommu: SR56x0 Erratum 64 -
	Reset all head & tail pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 5ea99fa5355c9bb768388b7cf86950fd808ab2d3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu May 23 10:16:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 10:16:28 2013 +0200

    AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
    
    Reference at time of patch:
    http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf
    
    Erratum 64 states that the head and tail pointers for the Command buffer and
    Event log are only reset on a cold boot, not a warm boot.
    
    While the erratum is limited to systems using SR56xx chipsets (such as Family
    10h CPUs), resetting the pointers is a sensible action in all cases, including
    the PPR log for consistency.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6d243308e1d75f866679db226159c797d6c83aad
    master date: 2013-05-22 15:26:52 +0200
---
 xen/drivers/passthrough/amd/iommu_init.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index ebf964c..d876972 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -154,6 +154,11 @@ static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
@@ -182,6 +187,11 @@ static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
 }
 
 static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
@@ -210,6 +220,9 @@ static void register_iommu_ppr_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_PPR_LOG_LENGTH_MASK,
                         IOMMU_PPR_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base + IOMMU_PPR_LOG_BASE_HIGH_OFFSET);
+
+    writel(0, iommu->mmio_base + IOMMU_PPR_LOG_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET);
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19: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 1Ufb5X-0004ZY-O6; Thu, 23 May 2013 19:22:11 +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 1Ufb5V-0004ZT-Lf
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:09 +0000
Received: from [85.158.139.83:62198] by server-1.bemta-5.messagelabs.com id
	EA/AF-01720-06C6E915; Thu, 23 May 2013 19:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1369336926!21554060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13501 invoked from network); 23 May 2013 19:22:07 -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;
	23 May 2013 19:22: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 1Ufb5Q-00020K-AK
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5O-0000Yw-V2
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:03 +0000
Date: Thu, 23 May 2013 19:22:02 +0000
Message-Id: <E1Ufb5O-0000Yw-V2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/IO-APIC: fix guest RTE write
	corner cases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 eb5d926ff01b632d8e39827f3ccd2b7f0fb54ed6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:14:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:14:29 2013 +0200

    x86/IO-APIC: fix guest RTE write corner cases
    
    This fixes two regressions from c/s 20143:a7de5bd776ca ("x86: Make the
    hypercall PHYSDEVOP_alloc_irq_vector hypercall dummy"):
    
    For one, IRQs that had their vector set up by Xen internally without a
    handler ever having got set (e.g. via "com<n>=..." without a matching
    consumer option like "console=com<n>") would wrongly call
    add_pin_to_irq() here, triggering the BUG_ON() in that function.
    
    Second, when assign_irq_vector() fails this addition to irq_2_pin[]
    needs to be undone.
    
    In the context of this I'm also surprised that the irq_2_pin[]
    manipulations here occur without any lock, i.e. rely on Dom0 to do
    some sort of serialization.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 30256a0ff17f6f3b1278b85103187341d5b0ac42
    master date: 2013-05-15 10:52:02 +0200
---
 xen/arch/x86/io_apic.c    |   57 +++++++++++++++++++++++++++++++++++++++-----
 xen/arch/x86/irq.c        |    2 -
 xen/include/asm-x86/irq.h |    2 +
 3 files changed, 52 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 4378d8e..240da6e 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -141,6 +141,37 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin)
     share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
+static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
+{
+    struct irq_pin_list *entry, *prev;
+
+    for (entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next]) {
+        if ((entry->apic == apic) && (entry->pin == pin))
+            break;
+        BUG_ON(!entry->next);
+    }
+
+    entry->pin = entry->apic = -1;
+
+    if (entry != &irq_2_pin[irq]) {
+        /* Removed entry is not at head of list. */
+        prev = &irq_2_pin[irq];
+        while (&irq_2_pin[prev->next] != entry)
+            prev = &irq_2_pin[prev->next];
+        prev->next = entry->next;
+    } else if (entry->next) {
+        /* Removed entry is at head of multi-item list. */
+        prev  = entry;
+        entry = &irq_2_pin[entry->next];
+        *prev = *entry;
+        entry->pin = entry->apic = -1;
+    } else
+        return;
+
+    entry->next = irq_2_pin_free_entry;
+    irq_2_pin_free_entry = entry - irq_2_pin;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -2447,7 +2478,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
-    int apic, pin, irq, ret, vector, pirq;
+    int apic, pin, irq, ret, pirq;
     struct IO_APIC_route_entry rte = { 0 };
     unsigned long flags;
     struct irq_cfg *cfg;
@@ -2517,13 +2548,25 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         return 0;
     }
 
-    if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {
-        add_pin_to_irq(irq, apic, pin);
-        vector = assign_irq_vector(irq);
-        if ( vector < 0 )
-            return vector;
+    if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR )
+    {
+        int vector = cfg->vector;
+
+        if ( vector < FIRST_HIPRIORITY_VECTOR )
+            add_pin_to_irq(irq, apic, pin);
+        else
+            cfg->vector = IRQ_VECTOR_UNASSIGNED;
+        ret = assign_irq_vector(irq);
+        if ( ret < 0 )
+        {
+            if ( vector < FIRST_HIPRIORITY_VECTOR )
+                remove_pin_from_irq(irq, apic, pin);
+            else
+                cfg->vector = vector;
+            return ret;
+        }
 
-        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
     spin_lock(&pcidevs_lock);
     spin_lock(&dom0->event_lock);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7e2c212..e91c069 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -48,8 +48,6 @@ int __read_mostly *irq_status = NULL;
 #define IRQ_USED        (1)
 #define IRQ_RSVD        (2)
 
-#define IRQ_VECTOR_UNASSIGNED (0)
-
 static DECLARE_BITMAP(used_vectors, NR_VECTORS);
 
 struct irq_cfg __read_mostly *irq_cfg = NULL;
diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
index 5d4f793..d688f10 100644
--- a/xen/include/asm-x86/irq.h
+++ b/xen/include/asm-x86/irq.h
@@ -17,6 +17,8 @@
 
 #define MSI_IRQ(irq)       ((irq) >= nr_irqs_gsi && (irq) < nr_irqs)
 
+#define IRQ_VECTOR_UNASSIGNED 0
+
 #define LEGACY_VECTOR(irq)          ((irq) + FIRST_LEGACY_VECTOR)
 #define LEGACY_IRQ_FROM_VECTOR(vec) ((vec) - FIRST_LEGACY_VECTOR)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19: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 1Ufb5X-0004ZY-O6; Thu, 23 May 2013 19:22:11 +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 1Ufb5V-0004ZT-Lf
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:09 +0000
Received: from [85.158.139.83:62198] by server-1.bemta-5.messagelabs.com id
	EA/AF-01720-06C6E915; Thu, 23 May 2013 19:22:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1369336926!21554060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13501 invoked from network); 23 May 2013 19:22:07 -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;
	23 May 2013 19:22: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 1Ufb5Q-00020K-AK
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5O-0000Yw-V2
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:03 +0000
Date: Thu, 23 May 2013 19:22:02 +0000
Message-Id: <E1Ufb5O-0000Yw-V2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/IO-APIC: fix guest RTE write
	corner cases
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 eb5d926ff01b632d8e39827f3ccd2b7f0fb54ed6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:14:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:14:29 2013 +0200

    x86/IO-APIC: fix guest RTE write corner cases
    
    This fixes two regressions from c/s 20143:a7de5bd776ca ("x86: Make the
    hypercall PHYSDEVOP_alloc_irq_vector hypercall dummy"):
    
    For one, IRQs that had their vector set up by Xen internally without a
    handler ever having got set (e.g. via "com<n>=..." without a matching
    consumer option like "console=com<n>") would wrongly call
    add_pin_to_irq() here, triggering the BUG_ON() in that function.
    
    Second, when assign_irq_vector() fails this addition to irq_2_pin[]
    needs to be undone.
    
    In the context of this I'm also surprised that the irq_2_pin[]
    manipulations here occur without any lock, i.e. rely on Dom0 to do
    some sort of serialization.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 30256a0ff17f6f3b1278b85103187341d5b0ac42
    master date: 2013-05-15 10:52:02 +0200
---
 xen/arch/x86/io_apic.c    |   57 +++++++++++++++++++++++++++++++++++++++-----
 xen/arch/x86/irq.c        |    2 -
 xen/include/asm-x86/irq.h |    2 +
 3 files changed, 52 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 4378d8e..240da6e 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -141,6 +141,37 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin)
     share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
+static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
+{
+    struct irq_pin_list *entry, *prev;
+
+    for (entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next]) {
+        if ((entry->apic == apic) && (entry->pin == pin))
+            break;
+        BUG_ON(!entry->next);
+    }
+
+    entry->pin = entry->apic = -1;
+
+    if (entry != &irq_2_pin[irq]) {
+        /* Removed entry is not at head of list. */
+        prev = &irq_2_pin[irq];
+        while (&irq_2_pin[prev->next] != entry)
+            prev = &irq_2_pin[prev->next];
+        prev->next = entry->next;
+    } else if (entry->next) {
+        /* Removed entry is at head of multi-item list. */
+        prev  = entry;
+        entry = &irq_2_pin[entry->next];
+        *prev = *entry;
+        entry->pin = entry->apic = -1;
+    } else
+        return;
+
+    entry->next = irq_2_pin_free_entry;
+    irq_2_pin_free_entry = entry - irq_2_pin;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -2447,7 +2478,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
-    int apic, pin, irq, ret, vector, pirq;
+    int apic, pin, irq, ret, pirq;
     struct IO_APIC_route_entry rte = { 0 };
     unsigned long flags;
     struct irq_cfg *cfg;
@@ -2517,13 +2548,25 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         return 0;
     }
 
-    if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {
-        add_pin_to_irq(irq, apic, pin);
-        vector = assign_irq_vector(irq);
-        if ( vector < 0 )
-            return vector;
+    if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR )
+    {
+        int vector = cfg->vector;
+
+        if ( vector < FIRST_HIPRIORITY_VECTOR )
+            add_pin_to_irq(irq, apic, pin);
+        else
+            cfg->vector = IRQ_VECTOR_UNASSIGNED;
+        ret = assign_irq_vector(irq);
+        if ( ret < 0 )
+        {
+            if ( vector < FIRST_HIPRIORITY_VECTOR )
+                remove_pin_from_irq(irq, apic, pin);
+            else
+                cfg->vector = vector;
+            return ret;
+        }
 
-        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
+        printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
     spin_lock(&pcidevs_lock);
     spin_lock(&dom0->event_lock);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7e2c212..e91c069 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -48,8 +48,6 @@ int __read_mostly *irq_status = NULL;
 #define IRQ_USED        (1)
 #define IRQ_RSVD        (2)
 
-#define IRQ_VECTOR_UNASSIGNED (0)
-
 static DECLARE_BITMAP(used_vectors, NR_VECTORS);
 
 struct irq_cfg __read_mostly *irq_cfg = NULL;
diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
index 5d4f793..d688f10 100644
--- a/xen/include/asm-x86/irq.h
+++ b/xen/include/asm-x86/irq.h
@@ -17,6 +17,8 @@
 
 #define MSI_IRQ(irq)       ((irq) >= nr_irqs_gsi && (irq) < nr_irqs)
 
+#define IRQ_VECTOR_UNASSIGNED 0
+
 #define LEGACY_VECTOR(irq)          ((irq) + FIRST_LEGACY_VECTOR)
 #define LEGACY_IRQ_FROM_VECTOR(vec) ((vec) - FIRST_LEGACY_VECTOR)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb5g-0004aP-7i; Thu, 23 May 2013 19:22:20 +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 1Ufb5e-0004a0-U7
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:19 +0000
Received: from [85.158.138.51:39184] by server-12.bemta-3.messagelabs.com id
	8E/69-17342-A6C6E915; Thu, 23 May 2013 19:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1369336936!19388703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 599 invoked from network); 23 May 2013 19:22:17 -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;
	23 May 2013 19:22: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 1Ufb5b-00020N-PI
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5b-0000ZZ-Jq
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:15 +0000
Date: Thu, 23 May 2013 19:22:15 +0000
Message-Id: <E1Ufb5b-0000ZZ-Jq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/shadow: fix off-by-one in MMIO
	permission check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a7dcae35f14db7d36bca7a5fbecfea468da152e4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:16:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:16:06 2013 +0200

    x86/shadow: fix off-by-one in MMIO permission check
    
    iomem_access_permitted() wants an inclusive range as input.
    
    Also use pfn_to_paddr() in nearby code instead of open coding it.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: afa65ddfd88184a894d9364bec587554c28c20e0
    master date: 2013-05-15 14:34:05 +0200
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 91879cf..944a8ec 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -602,13 +602,13 @@ _sh_propagate(struct vcpu *v,
         else if ( d->arch.hvm_domain.is_in_uc_mode )
             sflags |= pat_type_2_pte_flags(PAT_TYPE_UNCACHABLE);
         else
-            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn) + 1) )
+            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn)) )
             {
                 if ( p2mt == p2m_mmio_direct )
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             MTRR_TYPE_UNCACHABLE); 
                 else if ( iommu_snoop )
                     sflags |= pat_type_2_pte_flags(PAT_TYPE_WRBACK);
@@ -616,7 +616,7 @@ _sh_propagate(struct vcpu *v,
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             NO_HARDCODE_MEM_TYPE);
             }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb5g-0004aP-7i; Thu, 23 May 2013 19:22:20 +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 1Ufb5e-0004a0-U7
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:19 +0000
Received: from [85.158.138.51:39184] by server-12.bemta-3.messagelabs.com id
	8E/69-17342-A6C6E915; Thu, 23 May 2013 19:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1369336936!19388703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 599 invoked from network); 23 May 2013 19:22:17 -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;
	23 May 2013 19:22: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 1Ufb5b-00020N-PI
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5b-0000ZZ-Jq
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:15 +0000
Date: Thu, 23 May 2013 19:22:15 +0000
Message-Id: <E1Ufb5b-0000ZZ-Jq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/shadow: fix off-by-one in MMIO
	permission check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 a7dcae35f14db7d36bca7a5fbecfea468da152e4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:16:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:16:06 2013 +0200

    x86/shadow: fix off-by-one in MMIO permission check
    
    iomem_access_permitted() wants an inclusive range as input.
    
    Also use pfn_to_paddr() in nearby code instead of open coding it.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: afa65ddfd88184a894d9364bec587554c28c20e0
    master date: 2013-05-15 14:34:05 +0200
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 91879cf..944a8ec 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -602,13 +602,13 @@ _sh_propagate(struct vcpu *v,
         else if ( d->arch.hvm_domain.is_in_uc_mode )
             sflags |= pat_type_2_pte_flags(PAT_TYPE_UNCACHABLE);
         else
-            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn) + 1) )
+            if ( iomem_access_permitted(d, mfn_x(target_mfn), mfn_x(target_mfn)) )
             {
                 if ( p2mt == p2m_mmio_direct )
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             MTRR_TYPE_UNCACHABLE); 
                 else if ( iommu_snoop )
                     sflags |= pat_type_2_pte_flags(PAT_TYPE_WRBACK);
@@ -616,7 +616,7 @@ _sh_propagate(struct vcpu *v,
                     sflags |= get_pat_flags(v,
                             gflags,
                             gfn_to_paddr(target_gfn),
-                            ((paddr_t)mfn_x(target_mfn)) << PAGE_SHIFT,
+                            pfn_to_paddr(mfn_x(target_mfn)),
                             NO_HARDCODE_MEM_TYPE);
             }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb5r-0004bW-Ck; Thu, 23 May 2013 19:22:31 +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 1Ufb5q-0004bL-BB
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:30 +0000
Received: from [85.158.143.99:50613] by server-3.bemta-4.messagelabs.com id
	A9/7F-02015-57C6E915; Thu, 23 May 2013 19:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1369336947!29001366!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22690 invoked from network); 23 May 2013 19:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 May 2013 19:22: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 1Ufb5m-00020Q-Rp
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5l-0000an-TQ
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:25 +0000
Date: Thu, 23 May 2013 19:22:25 +0000
Message-Id: <E1Ufb5l-0000an-TQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] fix XSA-46 regression with xend/xm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 22d89f4a0960ee07f55da153b8f35e0b4389e029
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:16:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:16:44 2013 +0200

    fix XSA-46 regression with xend/xm
    
    The hypervisor side changes for XSA-46 require the tool stack to now
    always map the guest pIRQ before granting access permission to the
    underlying host IRQ (GSI). This in particular requires that pciif.py
    no longer can skip this step (assuming qemu would do it) for HVM
    guests.
    
    This in turn exposes, however, an inconsistency between xend and qemu:
    The former wants to always establish 1:1 mappings between pIRQ and host
    IRQ (for non-MSI only of course), while the latter always wants to
    allocate an arbitrary mapping. Since the whole tool stack obviously
    should always agree on the mapping model, make libxc enforce the 1:1
    mapping as the more natural one (as well as being the one that allows
    for easier debugging, since there no need to find out the extra
    mapping). Users of libxc that want to establish a particular (rather
    than an allocated) mapping are still free to do so, as well as tool
    stacks not based on libxc wanting to implement an allocation based
    model (which is why it's not the hypervisor that's being changed to
    enforce either model).
    
    Since libxl, like xend, already uses a 1:1 model, it's unaffected by
    the libxc change (and it being unaffected by the original hypervisor
    side changes is - afaict - simply due to qemu getting spawned at a
    later point in time compared to the xend event flow).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
    Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 934a5253d932b6f67fe40fc48975a2b0117e4cce
    master date: 2013-05-21 11:32:34 +0200
---
 tools/libxc/xc_physdev.c              |    2 +-
 tools/python/xen/xend/server/pciif.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index bdbcba7..cf02d85 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
     map.domid = domid;
     map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
-    map.pirq = *pirq;
+    map.pirq = *pirq < 0 ? index : *pirq;
 
     rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
 
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
index 43d0c80..27c1b75 100644
--- a/tools/python/xen/xend/server/pciif.py
+++ b/tools/python/xen/xend/server/pciif.py
@@ -340,7 +340,7 @@ class PciController(DevController):
                 raise VmError(('pci: failed to configure I/O memory on device '+
                             '%s - errno=%d')%(dev.name,rc))
 
-        if not self.vm.info.is_hvm() and dev.irq:
+        if dev.irq > 0:
             rc = xc.physdev_map_pirq(domid = fe_domid,
                                    index = dev.irq,
                                    pirq  = dev.irq)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb5r-0004bW-Ck; Thu, 23 May 2013 19:22:31 +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 1Ufb5q-0004bL-BB
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:30 +0000
Received: from [85.158.143.99:50613] by server-3.bemta-4.messagelabs.com id
	A9/7F-02015-57C6E915; Thu, 23 May 2013 19:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1369336947!29001366!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22690 invoked from network); 23 May 2013 19:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	23 May 2013 19:22: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 1Ufb5m-00020Q-Rp
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5l-0000an-TQ
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:25 +0000
Date: Thu, 23 May 2013 19:22:25 +0000
Message-Id: <E1Ufb5l-0000an-TQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] fix XSA-46 regression with xend/xm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 22d89f4a0960ee07f55da153b8f35e0b4389e029
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:16:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:16:44 2013 +0200

    fix XSA-46 regression with xend/xm
    
    The hypervisor side changes for XSA-46 require the tool stack to now
    always map the guest pIRQ before granting access permission to the
    underlying host IRQ (GSI). This in particular requires that pciif.py
    no longer can skip this step (assuming qemu would do it) for HVM
    guests.
    
    This in turn exposes, however, an inconsistency between xend and qemu:
    The former wants to always establish 1:1 mappings between pIRQ and host
    IRQ (for non-MSI only of course), while the latter always wants to
    allocate an arbitrary mapping. Since the whole tool stack obviously
    should always agree on the mapping model, make libxc enforce the 1:1
    mapping as the more natural one (as well as being the one that allows
    for easier debugging, since there no need to find out the extra
    mapping). Users of libxc that want to establish a particular (rather
    than an allocated) mapping are still free to do so, as well as tool
    stacks not based on libxc wanting to implement an allocation based
    model (which is why it's not the hypervisor that's being changed to
    enforce either model).
    
    Since libxl, like xend, already uses a 1:1 model, it's unaffected by
    the libxc change (and it being unaffected by the original hypervisor
    side changes is - afaict - simply due to qemu getting spawned at a
    later point in time compared to the xend event flow).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
    Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 934a5253d932b6f67fe40fc48975a2b0117e4cce
    master date: 2013-05-21 11:32:34 +0200
---
 tools/libxc/xc_physdev.c              |    2 +-
 tools/python/xen/xend/server/pciif.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index bdbcba7..cf02d85 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
     map.domid = domid;
     map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
-    map.pirq = *pirq;
+    map.pirq = *pirq < 0 ? index : *pirq;
 
     rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
 
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
index 43d0c80..27c1b75 100644
--- a/tools/python/xen/xend/server/pciif.py
+++ b/tools/python/xen/xend/server/pciif.py
@@ -340,7 +340,7 @@ class PciController(DevController):
                 raise VmError(('pci: failed to configure I/O memory on device '+
                             '%s - errno=%d')%(dev.name,rc))
 
-        if not self.vm.info.is_hvm() and dev.irq:
+        if dev.irq > 0:
             rc = xc.physdev_map_pirq(domid = fe_domid,
                                    index = dev.irq,
                                    pirq  = dev.irq)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb61-0004dH-G5; Thu, 23 May 2013 19:22: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 1Ufb60-0004cg-FV
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:40 +0000
Received: from [85.158.139.211:55046] by server-15.bemta-5.messagelabs.com id
	B3/3C-31797-F7C6E915; Thu, 23 May 2013 19:22:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1369336957!19290480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25195 invoked from network); 23 May 2013 19:22:38 -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;
	23 May 2013 19:22: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 1Ufb5x-00020Z-2V
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5x-0000bD-0J
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:37 +0000
Date: Thu, 23 May 2013 19:22:37 +0000
Message-Id: <E1Ufb5x-0000bD-0J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] AMD/iommu: SR56x0 Erratum 64 -
	Reset all head & tail pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 22de18bb89e776f77256653901a590aad9fc0a52
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu May 23 15:17:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:17:04 2013 +0200

    AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
    
    Reference at time of patch:
    http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf
    
    Erratum 64 states that the head and tail pointers for the Command buffer and
    Event log are only reset on a cold boot, not a warm boot.
    
    While the erratum is limited to systems using SR56xx chipsets (such as Family
    10h CPUs), resetting the pointers is a sensible action in all cases, including
    the PPR log for consistency.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6d243308e1d75f866679db226159c797d6c83aad
    master date: 2013-05-22 15:26:52 +0200
---
 xen/drivers/passthrough/amd/iommu_init.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index fcb7e87..adf220b 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -119,6 +119,11 @@ static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
@@ -146,6 +151,11 @@ static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
 }
 
 static void set_iommu_translation_control(struct amd_iommu *iommu,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb61-0004dH-G5; Thu, 23 May 2013 19:22: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 1Ufb60-0004cg-FV
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:40 +0000
Received: from [85.158.139.211:55046] by server-15.bemta-5.messagelabs.com id
	B3/3C-31797-F7C6E915; Thu, 23 May 2013 19:22:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1369336957!19290480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25195 invoked from network); 23 May 2013 19:22:38 -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;
	23 May 2013 19:22: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 1Ufb5x-00020Z-2V
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb5x-0000bD-0J
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:37 +0000
Date: Thu, 23 May 2013 19:22:37 +0000
Message-Id: <E1Ufb5x-0000bD-0J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] AMD/iommu: SR56x0 Erratum 64 -
	Reset all head & tail pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 22de18bb89e776f77256653901a590aad9fc0a52
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu May 23 15:17:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:17:04 2013 +0200

    AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
    
    Reference at time of patch:
    http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf
    
    Erratum 64 states that the head and tail pointers for the Command buffer and
    Event log are only reset on a cold boot, not a warm boot.
    
    While the erratum is limited to systems using SR56xx chipsets (such as Family
    10h CPUs), resetting the pointers is a sensible action in all cases, including
    the PPR log for consistency.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6d243308e1d75f866679db226159c797d6c83aad
    master date: 2013-05-22 15:26:52 +0200
---
 xen/drivers/passthrough/amd/iommu_init.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index fcb7e87..adf220b 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -119,6 +119,11 @@ static void register_iommu_cmd_buffer_in_mmio_space(struct amd_iommu *iommu)
                          IOMMU_CMD_BUFFER_LENGTH_MASK,
                          IOMMU_CMD_BUFFER_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_CMD_BUFFER_TAIL_OFFSET);
 }
 
 static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
@@ -146,6 +151,11 @@ static void register_iommu_event_log_in_mmio_space(struct amd_iommu *iommu)
                         IOMMU_EVENT_LOG_LENGTH_MASK,
                         IOMMU_EVENT_LOG_LENGTH_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_EVENT_LOG_BASE_HIGH_OFFSET);
+
+    /* Reset head/tail pointer. SR56x0 Erratum 64 means this might not happen
+     * automatically for us. */
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_HEAD_OFFSET);
+    writel(0, iommu->mmio_base + IOMMU_EVENT_LOG_TAIL_OFFSET);
 }
 
 static void set_iommu_translation_control(struct amd_iommu *iommu,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb6B-0004fB-Iz; Thu, 23 May 2013 19:22: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 1Ufb6A-0004et-0C
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:50 +0000
Received: from [85.158.143.99:48366] by server-2.bemta-4.messagelabs.com id
	57/E6-27124-98C6E915; Thu, 23 May 2013 19:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1369336967!31930357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22459 invoked from network); 23 May 2013 19:22:48 -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;
	23 May 2013 19:22: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 1Ufb67-00020i-8q
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb67-0000bZ-6S
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:47 +0000
Date: Thu, 23 May 2013 19:22:47 +0000
Message-Id: <E1Ufb67-0000bZ-6S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] tools: fix dependency file
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 682949335b90b5fcf3a600d7067453b459a04af2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:19:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:19:38 2013 +0200

    tools: fix dependency file generation
    
    There is a small set of places where files in subdirectories get
    compiled from the parent directory. Dependency file wise this is no
    problem as long as the files use names distinct without regard to the
    directories they sit in, and tools/console/ violates this (in having
    two main.c files). Hence we need to avoid losing the directory name,
    both to ensure the two compiler instances don't simultaneously write
    to the same file (happening of which is what triggered me looking
    into this) and to guarantee dependencies for all files will be seen
    by make on an incremental rebuild.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 4d788e164d6556d931bc3e0a69e36b8cf7280794
    master date: 2013-05-21 10:16:30 +0200
---
 tools/Rules.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index f7dda35..42a9cde 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -45,7 +45,7 @@ X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR)
 CFLAGS += -D__XEN_TOOLS__
 
 # Get gcc to generate the dependencies for us.
-CFLAGS += -MMD -MF .$(@F).d
+CFLAGS += -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
 DEPS = .*.d
 
 ifneq ($(XEN_OS),NetBSD)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu May 23 19:22:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 May 2013 19:22: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 1Ufb6B-0004fB-Iz; Thu, 23 May 2013 19:22: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 1Ufb6A-0004et-0C
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:50 +0000
Received: from [85.158.143.99:48366] by server-2.bemta-4.messagelabs.com id
	57/E6-27124-98C6E915; Thu, 23 May 2013 19:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1369336967!31930357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22459 invoked from network); 23 May 2013 19:22:48 -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;
	23 May 2013 19:22: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 1Ufb67-00020i-8q
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Ufb67-0000bZ-6S
	for xen-changelog@lists.xensource.com; Thu, 23 May 2013 19:22:47 +0000
Date: Thu, 23 May 2013 19:22:47 +0000
Message-Id: <E1Ufb67-0000bZ-6S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] tools: fix dependency file
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 682949335b90b5fcf3a600d7067453b459a04af2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 15:19:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 15:19:38 2013 +0200

    tools: fix dependency file generation
    
    There is a small set of places where files in subdirectories get
    compiled from the parent directory. Dependency file wise this is no
    problem as long as the files use names distinct without regard to the
    directories they sit in, and tools/console/ violates this (in having
    two main.c files). Hence we need to avoid losing the directory name,
    both to ensure the two compiler instances don't simultaneously write
    to the same file (happening of which is what triggered me looking
    into this) and to guarantee dependencies for all files will be seen
    by make on an incremental rebuild.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 4d788e164d6556d931bc3e0a69e36b8cf7280794
    master date: 2013-05-21 10:16:30 +0200
---
 tools/Rules.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index f7dda35..42a9cde 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -45,7 +45,7 @@ X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR)
 CFLAGS += -D__XEN_TOOLS__
 
 # Get gcc to generate the dependencies for us.
-CFLAGS += -MMD -MF .$(@F).d
+CFLAGS += -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d
 DEPS = .*.d
 
 ifneq ($(XEN_OS),NetBSD)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06: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 1UflDX-0005Nr-SZ; Fri, 24 May 2013 06:11: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 1UflDW-0005Nm-SO
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:06 +0000
Received: from [85.158.139.83:8267] by server-9.bemta-5.messagelabs.com id
	F1/6E-14875-A740F915; Fri, 24 May 2013 06:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1369375864!28162545!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 724 invoked from network); 24 May 2013 06:11:05 -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;
	24 May 2013 06:11: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 1UflDT-0007sZ-Od
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDT-0007da-LM
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:03 +0000
Date: Fri, 24 May 2013 06:11:03 +0000
Message-Id: <E1UflDT-0007da-LM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove leading +1 when
	hypervisor compat property is created
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0bb8977dca01321b5ea6f86bf62431783a49a955
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 16 23:34:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 11:35:04 2013 +0100

    xen/arm: Remove leading +1 when hypervisor compat property is created
    
    When a static array with string is created, the size of this array contains
    the \0.
    
    This error was raised with gcc 4.7 because, the local variables are not always
    initialized to 0.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain_build.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 8369099..b92c64b 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -279,7 +279,7 @@ static void make_hypervisor_node(void *fdt, int addrcells, int sizecells)
     fdt_begin_node(fdt, "hypervisor");
 
     /* Cannot use fdt_property_string due to embedded nulls */
-    fdt_property(fdt, "compatible", compat, sizeof(compat) + 1);
+    fdt_property(fdt, "compatible", compat, sizeof(compat));
 
     /* reg 0 is grant table space */
     cell = &reg[0];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06: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 1UflDX-0005Nr-SZ; Fri, 24 May 2013 06:11: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 1UflDW-0005Nm-SO
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:06 +0000
Received: from [85.158.139.83:8267] by server-9.bemta-5.messagelabs.com id
	F1/6E-14875-A740F915; Fri, 24 May 2013 06:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1369375864!28162545!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 724 invoked from network); 24 May 2013 06:11:05 -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;
	24 May 2013 06:11: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 1UflDT-0007sZ-Od
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDT-0007da-LM
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:03 +0000
Date: Fri, 24 May 2013 06:11:03 +0000
Message-Id: <E1UflDT-0007da-LM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Remove leading +1 when
	hypervisor compat property is created
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 0bb8977dca01321b5ea6f86bf62431783a49a955
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 16 23:34:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 11:35:04 2013 +0100

    xen/arm: Remove leading +1 when hypervisor compat property is created
    
    When a static array with string is created, the size of this array contains
    the \0.
    
    This error was raised with gcc 4.7 because, the local variables are not always
    initialized to 0.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain_build.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 8369099..b92c64b 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -279,7 +279,7 @@ static void make_hypervisor_node(void *fdt, int addrcells, int sizecells)
     fdt_begin_node(fdt, "hypervisor");
 
     /* Cannot use fdt_property_string due to embedded nulls */
-    fdt_property(fdt, "compatible", compat, sizeof(compat) + 1);
+    fdt_property(fdt, "compatible", compat, sizeof(compat));
 
     /* reg 0 is grant table space */
     cell = &reg[0];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06: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 1UflDj-0005Ob-VU; Fri, 24 May 2013 06:11:19 +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 1UflDi-0005OS-WF
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:19 +0000
Received: from [85.158.138.51:41204] by server-5.bemta-3.messagelabs.com id
	B8/87-29713-4840F915; Fri, 24 May 2013 06:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1369375875!1009759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6890 invoked from network); 24 May 2013 06:11:16 -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;
	24 May 2013 06:11: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 1UflDe-0007sf-Oo
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDd-0007eh-TP
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:13 +0000
Date: Fri, 24 May 2013 06:11:13 +0000
Message-Id: <E1UflDd-0007eh-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/Linux: xendomains
	compatibility with xl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 13b37b6e08679d810544c99e69cfd81b7d34db18
Author:     Ian Murray <murrayie@yahoo.co.uk>
AuthorDate: Thu May 23 11:33:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 11:35:07 2013 +0100

    hotplug/Linux: xendomains compatibility with xl
    
    The xl save file uses a different header string to the xm one. Teach the
    xendomains script about it.
    
    Signed-off-by: Ian MURRAY <murrayie@yahoo.co.uk>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- rewrote commit message ]
---
 tools/hotplug/Linux/init.d/xendomains |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 2a1999a..730541e 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -30,10 +30,12 @@
 . /etc/xen/scripts/hotplugpath.sh
 
 CMD=${SBINDIR}/xm
+HEADCOMP="LinuxGuestRecord"
 $CMD list &> /dev/null
 if test $? -ne 0
 then
 	CMD=${SBINDIR}/xl
+	HEADCOMP="Xen saved domain"
 fi
 
 $CMD list &> /dev/null
@@ -257,7 +259,7 @@ start()
         for dom in $XENDOMAINS_SAVE/*; do
             if [ -f $dom ] ; then
                 HEADER=`head -c 16 $dom | head -n 1 2> /dev/null`
-                if [ $HEADER = "LinuxGuestRecord" ]; then
+                if [ "$HEADER" = "$HEADCOMP" ]; then
                     echo -n " ${dom##*/}"
                     XMR=`$CMD restore $dom 2>&1 1>/dev/null`
                     #$CMD restore $dom
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06: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 1UflDj-0005Ob-VU; Fri, 24 May 2013 06:11:19 +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 1UflDi-0005OS-WF
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:19 +0000
Received: from [85.158.138.51:41204] by server-5.bemta-3.messagelabs.com id
	B8/87-29713-4840F915; Fri, 24 May 2013 06:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1369375875!1009759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6890 invoked from network); 24 May 2013 06:11:16 -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;
	24 May 2013 06:11: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 1UflDe-0007sf-Oo
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDd-0007eh-TP
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:13 +0000
Date: Fri, 24 May 2013 06:11:13 +0000
Message-Id: <E1UflDd-0007eh-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/Linux: xendomains
	compatibility with xl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 13b37b6e08679d810544c99e69cfd81b7d34db18
Author:     Ian Murray <murrayie@yahoo.co.uk>
AuthorDate: Thu May 23 11:33:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 11:35:07 2013 +0100

    hotplug/Linux: xendomains compatibility with xl
    
    The xl save file uses a different header string to the xm one. Teach the
    xendomains script about it.
    
    Signed-off-by: Ian MURRAY <murrayie@yahoo.co.uk>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- rewrote commit message ]
---
 tools/hotplug/Linux/init.d/xendomains |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 2a1999a..730541e 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -30,10 +30,12 @@
 . /etc/xen/scripts/hotplugpath.sh
 
 CMD=${SBINDIR}/xm
+HEADCOMP="LinuxGuestRecord"
 $CMD list &> /dev/null
 if test $? -ne 0
 then
 	CMD=${SBINDIR}/xl
+	HEADCOMP="Xen saved domain"
 fi
 
 $CMD list &> /dev/null
@@ -257,7 +259,7 @@ start()
         for dom in $XENDOMAINS_SAVE/*; do
             if [ -f $dom ] ; then
                 HEADER=`head -c 16 $dom | head -n 1 2> /dev/null`
-                if [ $HEADER = "LinuxGuestRecord" ]; then
+                if [ "$HEADER" = "$HEADCOMP" ]; then
                     echo -n " ${dom##*/}"
                     XMR=`$CMD restore $dom 2>&1 1>/dev/null`
                     #$CMD restore $dom
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06: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 1UflDt-0005PR-2l; Fri, 24 May 2013 06:11:29 +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 1UflDr-0005PI-Vc
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:28 +0000
Received: from [85.158.137.99:39446] by server-6.bemta-3.messagelabs.com id
	74/59-14331-F840F915; Fri, 24 May 2013 06:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1369375885!13438068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29057 invoked from network); 24 May 2013 06:11:26 -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;
	24 May 2013 06:11:26 -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 1UflDo-0007sl-Uv
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDo-0007f3-Rs
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:24 +0000
Date: Fri, 24 May 2013 06:11:24 +0000
Message-Id: <E1UflDo-0007f3-Rs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Disable interrupts for the
	entire duration of the context switch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9f5179a4ecafd9a15e0a066e0f935ded681bf997
Author:     Jaeyong Yoo <jaeyong.yoo@samsung.com>
AuthorDate: Wed May 22 02:34:18 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 12:51:51 2013 +0100

    xen/arm: Disable interrupts for the entire duration of the context switch
    
    Not just while saving state. Otherwise there is a race between interrupts
    arriving and updating the LR state and gic_restore_state overwriting them with
    the saved state.
    
    With this change we no longer need to disable interrupts in gic_restore_state.
    
    Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    [ ijc -- rewrote commit message ]
---
 xen/arch/arm/domain.c |    4 ++--
 xen/arch/arm/gic.c    |    2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 9ca44ea..ee12b5f 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -226,10 +226,10 @@ static void schedule_tail(struct vcpu *prev)
 {
     ctxt_switch_from(prev);
 
-    local_irq_enable();
-
     ctxt_switch_to(current);
 
+    local_irq_enable();
+
     if ( prev != current )
         update_runstate_area(current);
 }
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 30bf8d1..d9940ea 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -93,11 +93,9 @@ void gic_restore_state(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return;
 
-    spin_lock_irq(&gic.lock);
     this_cpu(lr_mask) = v->arch.lr_mask;
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
-    spin_unlock_irq(&gic.lock);
     GICH[GICH_APR] = v->arch.gic_apr;
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06: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 1UflDt-0005PR-2l; Fri, 24 May 2013 06:11:29 +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 1UflDr-0005PI-Vc
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:28 +0000
Received: from [85.158.137.99:39446] by server-6.bemta-3.messagelabs.com id
	74/59-14331-F840F915; Fri, 24 May 2013 06:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1369375885!13438068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29057 invoked from network); 24 May 2013 06:11:26 -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;
	24 May 2013 06:11:26 -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 1UflDo-0007sl-Uv
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDo-0007f3-Rs
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:24 +0000
Date: Fri, 24 May 2013 06:11:24 +0000
Message-Id: <E1UflDo-0007f3-Rs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Disable interrupts for the
	entire duration of the context switch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9f5179a4ecafd9a15e0a066e0f935ded681bf997
Author:     Jaeyong Yoo <jaeyong.yoo@samsung.com>
AuthorDate: Wed May 22 02:34:18 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 12:51:51 2013 +0100

    xen/arm: Disable interrupts for the entire duration of the context switch
    
    Not just while saving state. Otherwise there is a race between interrupts
    arriving and updating the LR state and gic_restore_state overwriting them with
    the saved state.
    
    With this change we no longer need to disable interrupts in gic_restore_state.
    
    Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    [ ijc -- rewrote commit message ]
---
 xen/arch/arm/domain.c |    4 ++--
 xen/arch/arm/gic.c    |    2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 9ca44ea..ee12b5f 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -226,10 +226,10 @@ static void schedule_tail(struct vcpu *prev)
 {
     ctxt_switch_from(prev);
 
-    local_irq_enable();
-
     ctxt_switch_to(current);
 
+    local_irq_enable();
+
     if ( prev != current )
         update_runstate_area(current);
 }
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 30bf8d1..d9940ea 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -93,11 +93,9 @@ void gic_restore_state(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return;
 
-    spin_lock_irq(&gic.lock);
     this_cpu(lr_mask) = v->arch.lr_mask;
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
-    spin_unlock_irq(&gic.lock);
     GICH[GICH_APR] = v->arch.gic_apr;
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:11: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 1UflE4-0005Qk-6H; Fri, 24 May 2013 06:11:40 +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 1UflE3-0005QX-0i
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:39 +0000
Received: from [85.158.143.99:38074] by server-2.bemta-4.messagelabs.com id
	11/1B-27124-A940F915; Fri, 24 May 2013 06:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1369375895!24149444!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4686 invoked from network); 24 May 2013 06:11:36 -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;
	24 May 2013 06:11: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 1UflDz-0007st-5n
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDz-0007fT-1J
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:35 +0000
Date: Fri, 24 May 2013 06:11:35 +0000
Message-Id: <E1UflDz-0007fT-1J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drivers/exynos4210: Return -ENOMEM
	when ioremap has failed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7312c21dbd3f5026f087ba72c4e36754f1921762
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 22 12:43:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 12:55:17 2013 +0100

    drivers/exynos4210: Return -ENOMEM when ioremap has failed
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/exynos4210-uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index f151390..f7971da 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -328,6 +328,7 @@ static int __init exynos4210_uart_init(struct dt_device_node *dev,
     if ( !uart->regs )
     {
         early_printk("exynos4210: Unable to map the UART memory\n");
+        return -ENOMEM;
     }
     res = dt_device_get_irq(dev, 0, &uart->irq);
     if ( res )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:11: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 1UflE4-0005Qk-6H; Fri, 24 May 2013 06:11:40 +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 1UflE3-0005QX-0i
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:39 +0000
Received: from [85.158.143.99:38074] by server-2.bemta-4.messagelabs.com id
	11/1B-27124-A940F915; Fri, 24 May 2013 06:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1369375895!24149444!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4686 invoked from network); 24 May 2013 06:11:36 -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;
	24 May 2013 06:11: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 1UflDz-0007st-5n
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflDz-0007fT-1J
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:35 +0000
Date: Fri, 24 May 2013 06:11:35 +0000
Message-Id: <E1UflDz-0007fT-1J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drivers/exynos4210: Return -ENOMEM
	when ioremap has failed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7312c21dbd3f5026f087ba72c4e36754f1921762
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed May 22 12:43:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 12:55:17 2013 +0100

    drivers/exynos4210: Return -ENOMEM when ioremap has failed
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/exynos4210-uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index f151390..f7971da 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -328,6 +328,7 @@ static int __init exynos4210_uart_init(struct dt_device_node *dev,
     if ( !uart->regs )
     {
         early_printk("exynos4210: Unable to map the UART memory\n");
+        return -ENOMEM;
     }
     res = dt_device_get_irq(dev, 0, &uart->irq);
     if ( res )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:11: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 1UflEE-0005S7-9f; Fri, 24 May 2013 06:11:50 +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 1UflEC-0005Rq-Mh
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:48 +0000
Received: from [193.109.254.147:18477] by server-6.bemta-14.messagelabs.com id
	23/F2-00912-3A40F915; Fri, 24 May 2013 06:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1369375906!8561729!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31096 invoked from network); 24 May 2013 06:11:47 -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;
	24 May 2013 06:11: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 1UflEA-0007sz-6n
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflEA-0007gB-3y
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:46 +0000
Date: Fri, 24 May 2013 06:11:46 +0000
Message-Id: <E1UflEA-0007gB-3y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix boot time APIC mode detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 234c4dde2fd4f1182fe1a6bea6bced83fe363007
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 13:08:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 13:08:32 2013 +0200

    x86: fix boot time APIC mode detection
    
    current_cpu_data becomes valid only relatively late in the boot
    process, so looking there for a particular feature early in the game
    would generally give the appearance of the feature being unavailable.
    
    Getting this wrong means that at kexec time the system would get
    returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
    the APIC page, which on systems with x2APIC pre-enabled will never get
    set up.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index b28f5ed..a52a0e8 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1474,7 +1474,7 @@ enum apic_mode current_local_apic_mode(void)
 
     /* Reading EXTD bit from the MSR is only valid if CPUID
      * says so, else reserved */
-    if ( cpu_has(&current_cpu_data, X86_FEATURE_X2APIC)
+    if ( boot_cpu_has(X86_FEATURE_X2APIC)
          && (msr_contents & MSR_IA32_APICBASE_EXTD) )
         return APIC_MODE_X2APIC;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:11:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:11: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 1UflEE-0005S7-9f; Fri, 24 May 2013 06:11:50 +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 1UflEC-0005Rq-Mh
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:48 +0000
Received: from [193.109.254.147:18477] by server-6.bemta-14.messagelabs.com id
	23/F2-00912-3A40F915; Fri, 24 May 2013 06:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1369375906!8561729!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31096 invoked from network); 24 May 2013 06:11:47 -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;
	24 May 2013 06:11: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 1UflEA-0007sz-6n
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflEA-0007gB-3y
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:46 +0000
Date: Fri, 24 May 2013 06:11:46 +0000
Message-Id: <E1UflEA-0007gB-3y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix boot time APIC mode detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 234c4dde2fd4f1182fe1a6bea6bced83fe363007
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 23 13:08:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 13:08:32 2013 +0200

    x86: fix boot time APIC mode detection
    
    current_cpu_data becomes valid only relatively late in the boot
    process, so looking there for a particular feature early in the game
    would generally give the appearance of the feature being unavailable.
    
    Getting this wrong means that at kexec time the system would get
    returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
    the APIC page, which on systems with x2APIC pre-enabled will never get
    set up.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index b28f5ed..a52a0e8 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1474,7 +1474,7 @@ enum apic_mode current_local_apic_mode(void)
 
     /* Reading EXTD bit from the MSR is only valid if CPUID
      * says so, else reserved */
-    if ( cpu_has(&current_cpu_data, X86_FEATURE_X2APIC)
+    if ( boot_cpu_has(X86_FEATURE_X2APIC)
          && (msr_contents & MSR_IA32_APICBASE_EXTD) )
         return APIC_MODE_X2APIC;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:12:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:12: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 1UflEQ-0005UU-0J; Fri, 24 May 2013 06:12:02 +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 1UflEN-0005U4-P1
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:59 +0000
Received: from [85.158.143.99:59182] by server-3.bemta-4.messagelabs.com id
	EF/45-02015-FA40F915; Fri, 24 May 2013 06:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1369375917!24149491!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6036 invoked from network); 24 May 2013 06:11:58 -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;
	24 May 2013 06:11: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 1UflEL-0007tB-4o
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflEK-0007gX-9M
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:56 +0000
Date: Fri, 24 May 2013 06:11:56 +0000
Message-Id: <E1UflEK-0007gX-9M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: fix boot for pre-UEFI systems
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 47f71a8ccb0c881cf3d9e0b917ef5f0dc084b062
Author:     Eric Shelton <eshelton@pobox.com>
AuthorDate: Thu May 23 13:08:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 13:08:51 2013 +0200

    x86/EFI: fix boot for pre-UEFI systems
    
    efi/boot.c makes a call to QueryVariableInfo on all systems.  However,
    as it is only promised for UEFI 2.0+ systems, pre-UEFI systems can
    hang or crash on this call.  The below patch adds a version check, a
    technique used in other parts of the Xen EFI codebase.
    
    Signed-off-by: Eric Shelton <eshelton@pobox.com>
    
    Check runtime services version instead of EFI version (while generally
    they would be in sync, nothing requires them to be).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/efi/boot.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 117a5cb..9718bd7 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -1241,12 +1241,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     setup_efi_pci();
 
     /* Get snapshot of variable store parameters. */
-    status = efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+    status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
+             efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
                                        EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                        EFI_VARIABLE_RUNTIME_ACCESS,
                                        &efi_boot_max_var_store_size,
                                        &efi_boot_remain_var_store_size,
-                                       &efi_boot_max_var_size);
+                                       &efi_boot_max_var_size) :
+             EFI_INCOMPATIBLE_VERSION;
     if ( EFI_ERROR(status) )
     {
         efi_boot_max_var_store_size = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:12:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:12: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 1UflEQ-0005UU-0J; Fri, 24 May 2013 06:12:02 +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 1UflEN-0005U4-P1
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:59 +0000
Received: from [85.158.143.99:59182] by server-3.bemta-4.messagelabs.com id
	EF/45-02015-FA40F915; Fri, 24 May 2013 06:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1369375917!24149491!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.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6036 invoked from network); 24 May 2013 06:11:58 -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;
	24 May 2013 06:11: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 1UflEL-0007tB-4o
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflEK-0007gX-9M
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:11:56 +0000
Date: Fri, 24 May 2013 06:11:56 +0000
Message-Id: <E1UflEK-0007gX-9M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: fix boot for pre-UEFI systems
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 47f71a8ccb0c881cf3d9e0b917ef5f0dc084b062
Author:     Eric Shelton <eshelton@pobox.com>
AuthorDate: Thu May 23 13:08:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 23 13:08:51 2013 +0200

    x86/EFI: fix boot for pre-UEFI systems
    
    efi/boot.c makes a call to QueryVariableInfo on all systems.  However,
    as it is only promised for UEFI 2.0+ systems, pre-UEFI systems can
    hang or crash on this call.  The below patch adds a version check, a
    technique used in other parts of the Xen EFI codebase.
    
    Signed-off-by: Eric Shelton <eshelton@pobox.com>
    
    Check runtime services version instead of EFI version (while generally
    they would be in sync, nothing requires them to be).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/efi/boot.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 117a5cb..9718bd7 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -1241,12 +1241,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     setup_efi_pci();
 
     /* Get snapshot of variable store parameters. */
-    status = efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+    status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
+             efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
                                        EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                        EFI_VARIABLE_RUNTIME_ACCESS,
                                        &efi_boot_max_var_store_size,
                                        &efi_boot_remain_var_store_size,
-                                       &efi_boot_max_var_size);
+                                       &efi_boot_max_var_size) :
+             EFI_INCOMPATIBLE_VERSION;
     if ( EFI_ERROR(status) )
     {
         efi_boot_max_var_store_size = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UflEZ-0005We-3N; Fri, 24 May 2013 06:12:11 +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 1UflEY-0005WJ-3N
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:12:10 +0000
Received: from [193.109.254.147:14103] by server-6.bemta-14.messagelabs.com id
	D9/23-00912-9B40F915; Fri, 24 May 2013 06:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1369375927!9458519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6758 invoked from network); 24 May 2013 06:12:08 -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;
	24 May 2013 06:12: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 1UflEV-0007th-9h
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflEV-0007gu-7X
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:12:07 +0000
Date: Fri, 24 May 2013 06:12:07 +0000
Message-Id: <E1UflEV-0007gu-7X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen 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 da3bca931fbcf0cbdfec971aca234e7ec0f41e16
Merge: 7312c21dbd3f5026f087ba72c4e36754f1921762 47f71a8ccb0c881cf3d9e0b917ef5f0dc084b062
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 23 14:23:32 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 14:23:32 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/apic.c     |    2 +-
 xen/arch/x86/efi/boot.c |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 24 06:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 May 2013 06:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UflEZ-0005We-3N; Fri, 24 May 2013 06:12:11 +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 1UflEY-0005WJ-3N
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:12:10 +0000
Received: from [193.109.254.147:14103] by server-6.bemta-14.messagelabs.com id
	D9/23-00912-9B40F915; Fri, 24 May 2013 06:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1369375927!9458519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6758 invoked from network); 24 May 2013 06:12:08 -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;
	24 May 2013 06:12: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 1UflEV-0007th-9h
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UflEV-0007gu-7X
	for xen-changelog@lists.xensource.com; Fri, 24 May 2013 06:12:07 +0000
Date: Fri, 24 May 2013 06:12:07 +0000
Message-Id: <E1UflEV-0007gu-7X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen 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 da3bca931fbcf0cbdfec971aca234e7ec0f41e16
Merge: 7312c21dbd3f5026f087ba72c4e36754f1921762 47f71a8ccb0c881cf3d9e0b917ef5f0dc084b062
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 23 14:23:32 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 23 14:23:32 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/apic.c     |    2 +-
 xen/arch/x86/efi/boot.c |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 28 02:11:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 May 2013 02: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 1Uh9NV-0002CI-0W; Tue, 28 May 2013 02:11:09 +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 1Uh9NS-0002C3-Nm
	for xen-changelog@lists.xensource.com; Tue, 28 May 2013 02:11:06 +0000
Received: from [85.158.137.99:9590] by server-8.bemta-3.messagelabs.com id
	DA/EF-25864-93214A15; Tue, 28 May 2013 02:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1369707063!1701110!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18643 invoked from network); 28 May 2013 02:11:05 -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;
	28 May 2013 02:11: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 1Uh9NP-0007nY-Ju
	for xen-changelog@lists.xensource.com; Tue, 28 May 2013 02:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uh9NP-0001jW-71
	for xen-changelog@lists.xensource.com; Tue, 28 May 2013 02:11:03 +0000
Date: Tue, 28 May 2013 02:11:03 +0000
Message-Id: <E1Uh9NP-0001jW-71@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: re-enable
	VCPUOP_register_vcpu_time_memory_area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ae5092f420e87a4a6b541bf581378c8cc0ee3a99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 27 08:59:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 27 08:59:38 2013 +0200

    x86: re-enable VCPUOP_register_vcpu_time_memory_area
    
    By moving the call to update_vcpu_system_time() out of schedule() into
    arch-specific context switch code, the original problem of the function
    accessing the wrong domain's address space goes away (obvious even from
    patch context, as update_runstate_area() does similar copying).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/domain.c  |    3 +++
 xen/arch/x86/domain.c  |    9 +++------
 xen/arch/x86/hvm/hvm.c |    2 ++
 xen/common/schedule.c  |    2 --
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ee12b5f..4c434a1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -232,6 +232,9 @@ static void schedule_tail(struct vcpu *prev)
 
     if ( prev != current )
         update_runstate_area(current);
+
+    /* Ensure that the vcpu has an up-to-date time base. */
+    update_vcpu_system_time(current);
 }
 
 static void continue_new_vcpu(struct vcpu *prev)
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 161d1b3..5c89197 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -966,11 +966,6 @@ arch_do_vcpu_op(
 
     switch ( cmd )
     {
-    /*
-     * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given
-     * virtual address even when running in another domain's address space.
-     */
-#if 0
     case VCPUOP_register_vcpu_time_memory_area:
     {
         struct vcpu_register_time_memory_area area;
@@ -989,7 +984,6 @@ arch_do_vcpu_op(
 
         break;
     }
-#endif
 
     case VCPUOP_get_physid:
     {
@@ -1457,6 +1451,9 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
     if (prev != next)
         update_runstate_area(next);
 
+    /* Ensure that the vcpu has an up-to-date time base. */
+    update_vcpu_system_time(next);
+
     schedule_tail(next);
     BUG();
 }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index bcf9609..a962ce2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3191,6 +3191,7 @@ static long hvm_vcpu_op(
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
     case VCPUOP_register_vcpu_info:
+    case VCPUOP_register_vcpu_time_memory_area:
         rc = do_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
@@ -3249,6 +3250,7 @@ static long hvm_vcpu_op_compat32(
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
     case VCPUOP_register_vcpu_info:
+    case VCPUOP_register_vcpu_time_memory_area:
         rc = compat_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index e526602..a8398bd 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1231,8 +1231,6 @@ static void schedule(void)
     if ( next_slice.migrated )
         evtchn_move_pirqs(next);
 
-    /* Ensure that the domain has an up-to-date time base. */
-    update_vcpu_system_time(next);
     vcpu_periodic_timer_work(next);
 
     context_switch(prev, next);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue May 28 02:11:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 May 2013 02: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 1Uh9NV-0002CI-0W; Tue, 28 May 2013 02:11:09 +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 1Uh9NS-0002C3-Nm
	for xen-changelog@lists.xensource.com; Tue, 28 May 2013 02:11:06 +0000
Received: from [85.158.137.99:9590] by server-8.bemta-3.messagelabs.com id
	DA/EF-25864-93214A15; Tue, 28 May 2013 02:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1369707063!1701110!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18643 invoked from network); 28 May 2013 02:11:05 -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;
	28 May 2013 02:11: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 1Uh9NP-0007nY-Ju
	for xen-changelog@lists.xensource.com; Tue, 28 May 2013 02:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Uh9NP-0001jW-71
	for xen-changelog@lists.xensource.com; Tue, 28 May 2013 02:11:03 +0000
Date: Tue, 28 May 2013 02:11:03 +0000
Message-Id: <E1Uh9NP-0001jW-71@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: re-enable
	VCPUOP_register_vcpu_time_memory_area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 ae5092f420e87a4a6b541bf581378c8cc0ee3a99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 27 08:59:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 27 08:59:38 2013 +0200

    x86: re-enable VCPUOP_register_vcpu_time_memory_area
    
    By moving the call to update_vcpu_system_time() out of schedule() into
    arch-specific context switch code, the original problem of the function
    accessing the wrong domain's address space goes away (obvious even from
    patch context, as update_runstate_area() does similar copying).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/domain.c  |    3 +++
 xen/arch/x86/domain.c  |    9 +++------
 xen/arch/x86/hvm/hvm.c |    2 ++
 xen/common/schedule.c  |    2 --
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ee12b5f..4c434a1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -232,6 +232,9 @@ static void schedule_tail(struct vcpu *prev)
 
     if ( prev != current )
         update_runstate_area(current);
+
+    /* Ensure that the vcpu has an up-to-date time base. */
+    update_vcpu_system_time(current);
 }
 
 static void continue_new_vcpu(struct vcpu *prev)
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 161d1b3..5c89197 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -966,11 +966,6 @@ arch_do_vcpu_op(
 
     switch ( cmd )
     {
-    /*
-     * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given
-     * virtual address even when running in another domain's address space.
-     */
-#if 0
     case VCPUOP_register_vcpu_time_memory_area:
     {
         struct vcpu_register_time_memory_area area;
@@ -989,7 +984,6 @@ arch_do_vcpu_op(
 
         break;
     }
-#endif
 
     case VCPUOP_get_physid:
     {
@@ -1457,6 +1451,9 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
     if (prev != next)
         update_runstate_area(next);
 
+    /* Ensure that the vcpu has an up-to-date time base. */
+    update_vcpu_system_time(next);
+
     schedule_tail(next);
     BUG();
 }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index bcf9609..a962ce2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3191,6 +3191,7 @@ static long hvm_vcpu_op(
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
     case VCPUOP_register_vcpu_info:
+    case VCPUOP_register_vcpu_time_memory_area:
         rc = do_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
@@ -3249,6 +3250,7 @@ static long hvm_vcpu_op_compat32(
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
     case VCPUOP_register_vcpu_info:
+    case VCPUOP_register_vcpu_time_memory_area:
         rc = compat_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index e526602..a8398bd 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1231,8 +1231,6 @@ static void schedule(void)
     if ( next_slice.migrated )
         evtchn_move_pirqs(next);
 
-    /* Ensure that the domain has an up-to-date time base. */
-    update_vcpu_system_time(next);
     vcpu_periodic_timer_work(next);
 
     context_switch(prev, next);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 29 22:00:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 May 2013 22:00: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 1UhoPi-00019p-2A; Wed, 29 May 2013 22:00:10 +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 1UhoPh-00019k-Ag
	for xen-changelog@lists.xensource.com; Wed, 29 May 2013 22:00:09 +0000
Received: from [85.158.143.99:44854] by server-3.bemta-4.messagelabs.com id
	41/D0-02015-86A76A15; Wed, 29 May 2013 22:00:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1369864806!16408840!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4850 invoked from network); 29 May 2013 22:00:07 -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;
	29 May 2013 22:00: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 1UhoPb-0004G5-Cb
	for xen-changelog@lists.xensource.com; Wed, 29 May 2013 22:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UhoPb-0005dC-29
	for xen-changelog@lists.xensource.com; Wed, 29 May 2013 22:00:03 +0000
Date: Wed, 29 May 2013 22:00:03 +0000
Message-Id: <E1UhoPb-0005dC-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: limit cpu values when setting
	vcpu affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 41abbadef60e5fccdfd688579dd458f7f7887cf5
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed May 29 15:48:11 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed May 29 15:49:22 2013 +0100

    libxc: limit cpu values when setting vcpu affinity
    
    When support for pinning more than 64 cpus was added, check for cpu
    out-of-range values was removed. This can lead to subsequent
    out-of-bounds cpumap array accesses in case the cpu number is higher
    than the actual count.
    
    This patch returns the check.
    
    This is CVE-2013-2072 / XSA-56
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
---
 tools/python/xen/lowlevel/xc/xc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index e220f68..e611b24 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -228,6 +228,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
     int vcpu = 0, i;
     xc_cpumap_t cpumap;
     PyObject *cpulist = NULL;
+    int nr_cpus;
 
     static char *kwd_list[] = { "domid", "vcpu", "cpumap", NULL };
 
@@ -235,6 +236,10 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
                                       &dom, &vcpu, &cpulist) )
         return NULL;
 
+    nr_cpus = xc_get_max_cpus(self->xc_handle);
+    if ( nr_cpus == 0 )
+        return pyxc_error_to_exception(self->xc_handle);
+
     cpumap = xc_cpumap_alloc(self->xc_handle);
     if(cpumap == NULL)
         return pyxc_error_to_exception(self->xc_handle);
@@ -244,6 +249,13 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         for ( i = 0; i < PyList_Size(cpulist); i++ ) 
         {
             long cpu = PyInt_AsLong(PyList_GetItem(cpulist, i));
+            if ( cpu < 0 || cpu >= nr_cpus )
+            {
+                free(cpumap);
+                errno = EINVAL;
+                PyErr_SetFromErrno(xc_error_obj);
+                return NULL;
+            }
             cpumap[cpu / 8] |= 1 << (cpu % 8);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed May 29 22:00:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 May 2013 22:00: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 1UhoPi-00019p-2A; Wed, 29 May 2013 22:00:10 +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 1UhoPh-00019k-Ag
	for xen-changelog@lists.xensource.com; Wed, 29 May 2013 22:00:09 +0000
Received: from [85.158.143.99:44854] by server-3.bemta-4.messagelabs.com id
	41/D0-02015-86A76A15; Wed, 29 May 2013 22:00:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1369864806!16408840!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4850 invoked from network); 29 May 2013 22:00:07 -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;
	29 May 2013 22:00: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 1UhoPb-0004G5-Cb
	for xen-changelog@lists.xensource.com; Wed, 29 May 2013 22:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UhoPb-0005dC-29
	for xen-changelog@lists.xensource.com; Wed, 29 May 2013 22:00:03 +0000
Date: Wed, 29 May 2013 22:00:03 +0000
Message-Id: <E1UhoPb-0005dC-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: limit cpu values when setting
	vcpu affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 41abbadef60e5fccdfd688579dd458f7f7887cf5
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed May 29 15:48:11 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed May 29 15:49:22 2013 +0100

    libxc: limit cpu values when setting vcpu affinity
    
    When support for pinning more than 64 cpus was added, check for cpu
    out-of-range values was removed. This can lead to subsequent
    out-of-bounds cpumap array accesses in case the cpu number is higher
    than the actual count.
    
    This patch returns the check.
    
    This is CVE-2013-2072 / XSA-56
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
---
 tools/python/xen/lowlevel/xc/xc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index e220f68..e611b24 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -228,6 +228,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
     int vcpu = 0, i;
     xc_cpumap_t cpumap;
     PyObject *cpulist = NULL;
+    int nr_cpus;
 
     static char *kwd_list[] = { "domid", "vcpu", "cpumap", NULL };
 
@@ -235,6 +236,10 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
                                       &dom, &vcpu, &cpulist) )
         return NULL;
 
+    nr_cpus = xc_get_max_cpus(self->xc_handle);
+    if ( nr_cpus == 0 )
+        return pyxc_error_to_exception(self->xc_handle);
+
     cpumap = xc_cpumap_alloc(self->xc_handle);
     if(cpumap == NULL)
         return pyxc_error_to_exception(self->xc_handle);
@@ -244,6 +249,13 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         for ( i = 0; i < PyList_Size(cpulist); i++ ) 
         {
             long cpu = PyInt_AsLong(PyList_GetItem(cpulist, i));
+            if ( cpu < 0 || cpu >= nr_cpus )
+            {
+                free(cpumap);
+                errno = EINVAL;
+                PyErr_SetFromErrno(xc_error_obj);
+                return NULL;
+            }
             cpumap[cpu / 8] |= 1 << (cpu % 8);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12: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 1UiOrT-0002oE-Ta; Fri, 31 May 2013 12:55: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 1UiOrS-0002nI-Fr
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:14 +0000
Received: from [85.158.137.99:45352] by server-2.bemta-3.messagelabs.com id
	22/DF-24763-1BD98A15; Fri, 31 May 2013 12:55:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1370004909!16925645!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25900 invoked from network); 31 May 2013 12:55:10 -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;
	31 May 2013 12:55: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 1UiOrH-0004DX-MI
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrH-0004vJ-CI
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:03 +0000
Date: Fri, 31 May 2013 12:55:03 +0000
Message-Id: <E1UiOrH-0004vJ-CI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl, e820_host,
	PV passthrough: Fix guests crashing when memory == maxmem
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 d21b46e9b723b860ab6e32f6ad96dd4c650596c7
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Fri May 24 09:36:16 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:01:24 2013 +0100

    xl, e820_host, PV passthrough: Fix guests crashing when memory == maxmem
    
    The code had an obvious bug where it would assume that the balloon
    amount would always be _something_ and add an E820_RAM entry at the
    end of the E820 array. The added E820_RAM would contain the balloon amount
    plus the delta of memory that had to be subtracted b/c of the various
    E820 entries. That assumption is certainly true when maxmem != mem,
    but if guest config has maxmem = memory that is incorrect (as balloon
    value is zero). The end result is that the E820 that is constructed
    is missing a swath of "delta" memory and in most cases ends up with
    only one E820_RAM entry that is of 512MB size on many Intel systems.
    
    Reported-by: Christian Holpert <christian@holpert.de>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index a17f6ae..a78c91d 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -182,7 +182,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
         idx++;
     }
     /* At this point we have the mapped RAM + E820 entries from src. */
-    if (balloon_kb) {
+    if (balloon_kb || delta_kb) {
         /* and if we truncated the RAM region, then add it to the end. */
         e820[idx].type = E820_RAM;
         e820[idx].addr = (uint64_t)(1ULL << 32) > last ?
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12: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 1UiOrT-0002oE-Ta; Fri, 31 May 2013 12:55: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 1UiOrS-0002nI-Fr
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:14 +0000
Received: from [85.158.137.99:45352] by server-2.bemta-3.messagelabs.com id
	22/DF-24763-1BD98A15; Fri, 31 May 2013 12:55:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1370004909!16925645!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25900 invoked from network); 31 May 2013 12:55:10 -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;
	31 May 2013 12:55: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 1UiOrH-0004DX-MI
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrH-0004vJ-CI
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:03 +0000
Date: Fri, 31 May 2013 12:55:03 +0000
Message-Id: <E1UiOrH-0004vJ-CI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl, e820_host,
	PV passthrough: Fix guests crashing when memory == maxmem
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 d21b46e9b723b860ab6e32f6ad96dd4c650596c7
Author:     Konrad Rzeszutek Wilk <konrad@kernel.org>
AuthorDate: Fri May 24 09:36:16 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:01:24 2013 +0100

    xl, e820_host, PV passthrough: Fix guests crashing when memory == maxmem
    
    The code had an obvious bug where it would assume that the balloon
    amount would always be _something_ and add an E820_RAM entry at the
    end of the E820 array. The added E820_RAM would contain the balloon amount
    plus the delta of memory that had to be subtracted b/c of the various
    E820 entries. That assumption is certainly true when maxmem != mem,
    but if guest config has maxmem = memory that is incorrect (as balloon
    value is zero). The end result is that the E820 that is constructed
    is missing a swath of "delta" memory and in most cases ends up with
    only one E820_RAM entry that is of 512MB size on many Intel systems.
    
    Reported-by: Christian Holpert <christian@holpert.de>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index a17f6ae..a78c91d 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -182,7 +182,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
         idx++;
     }
     /* At this point we have the mapped RAM + E820 entries from src. */
-    if (balloon_kb) {
+    if (balloon_kb || delta_kb) {
         /* and if we truncated the RAM region, then add it to the end. */
         e820[idx].type = E820_RAM;
         e820[idx].addr = (uint64_t)(1ULL << 32) > last ?
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12: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 1UiOre-0002sV-0U; Fri, 31 May 2013 12: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 1UiOrc-0002rf-Fn
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:24 +0000
Received: from [85.158.137.99:19329] by server-1.bemta-3.messagelabs.com id
	8B/CD-06847-BBD98A15; Fri, 31 May 2013 12:55:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1370004919!13154550!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20464 invoked from network); 31 May 2013 12:55:20 -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;
	31 May 2013 12:55: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 1UiOrX-0004De-0O
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrW-0004wB-Nu
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:18 +0000
Date: Fri, 31 May 2013 12:55:18 +0000
Message-Id: <E1UiOrW-0004wB-Nu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Make stubdom buildsystem
	consistent with tools buildsystem
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1ecd5e015d67837bb094e9e8921dca4e90578f8a
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Mon May 13 10:24:31 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:07:53 2013 +0100

    stubdom: Make stubdom buildsystem consistent with tools buildsystem
    
    Use FETCHER for stubdom, too. This makes stubdom buildsystem
    more consistent with tools buildsystem.
    Fixes toplevel configure failure if wget is not found
    independent if we are going to build stubdom or not.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matt Wilson <msw@amazon.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/Stubdom.mk.in |    2 +-
 stubdom/Makefile     |   18 +++---
 stubdom/configure    |  152 ++++++++++++++++++++++++++++++++++---------------
 stubdom/configure.ac |    4 +-
 4 files changed, 117 insertions(+), 59 deletions(-)

diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index 432efd7..302842e 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -7,7 +7,7 @@ LIBDIR              := $(libdir)
 
 # Path Programs
 CMAKE               := @CMAKE@
-WGET                := @WGET@ -c
+FETCHER             := @FETCHER@
 
 # A debug build of stubdom? //FIXME: Someone make this do something
 debug               := @debug@
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9caccc4..35295f0 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -68,7 +68,7 @@ $(eval $(genpath-target))
 ##############
 
 newlib-$(NEWLIB_VERSION).tar.gz:
-	$(WGET) $(NEWLIB_URL)/$@
+	$(FETCHER) $@ $(NEWLIB_URL)/$@
 
 newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
 	tar xzf $<
@@ -94,7 +94,7 @@ $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
 ############
 
 zlib-$(ZLIB_VERSION).tar.gz:
-	$(WGET) $(ZLIB_URL)/$@
+	$(FETCHER) $@ $(ZLIB_URL)/$@
 
 zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz 
 	tar xzf $<
@@ -114,7 +114,7 @@ $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 ##############
 
 pciutils-$(LIBPCI_VERSION).tar.bz2:
-	$(WGET) $(LIBPCI_URL)/$@
+	$(FETCHER) $@ $(LIBPCI_URL)/$@
 
 pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
 	tar xjf $<
@@ -142,7 +142,7 @@ $(LIBPCI_STAMPFILE): pciutils-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) $(ZLIB_STAM
 ######
 
 lwip-$(LWIP_VERSION).tar.gz:
-	$(WGET) $(LWIP_URL)/$@
+	$(FETCHER) $@ $(LWIP_URL)/$@
 
 lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	tar xzf $<
@@ -154,7 +154,7 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 # cross-gmp
 #############
 gmp-$(GMP_VERSION).tar.bz2:
-	$(WGET) $(GMP_URL)/$@
+	$(FETCHER) $@ $(GMP_URL)/$@
 
 .PHONY: cross-gmp
 ifeq ($(XEN_TARGET_ARCH), x86_32)
@@ -180,7 +180,7 @@ $(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
 # cross-polarssl
 #############
 polarssl-$(POLARSSL_VERSION)-gpl.tgz:
-	$(WGET) $(POLARSSL_URL)/$@
+	$(FETCHER) $@ $(POLARSSL_URL)/$@
 
 polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
 	tar xzf $<
@@ -202,7 +202,7 @@ $(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XE
 # cross-tpmemu
 #############
 tpm_emulator-$(TPMEMU_VERSION).tar.gz:
-	$(WGET) $(TPMEMU_URL)/$@
+	$(FETCHER) $@ $(TPMEMU_URL)/$@
 
 tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	@if [ ! -f "$(CMAKE)" ]; then echo "cmake not installed! Install it and then rerun ./configure!"; false; fi
@@ -232,7 +232,7 @@ CAMLLIB = $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ocaml
 OCAML_STAMPFILE=$(CAMLLIB)/.dirstamp
 
 ocaml-$(OCAML_VERSION).tar.gz:
-	$(WGET) $(OCAML_URL)/$@
+	$(FETCHER) $@ $(OCAML_URL)/$@
 
 ocaml-$(XEN_TARGET_ARCH)/.dirstamp: ocaml-$(OCAML_VERSION).tar.gz ocaml.patch
 	tar xzf $<
@@ -385,7 +385,7 @@ vtpmmgr: cross-polarssl
 ######
 
 grub-$(GRUB_VERSION).tar.gz:
-	$(WGET) $(GRUB_URL)/$@
+	$(FETCHER) $@ $(GRUB_URL)/$@
 
 grub-upstream: grub-$(GRUB_VERSION).tar.gz
 	tar xzf $<
diff --git a/stubdom/configure b/stubdom/configure
index 218457f..de9329f 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -593,6 +593,8 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+FETCHER
+FTP
 WGET
 CMAKE
 extfiles
@@ -657,7 +659,6 @@ enable_extfiles
 host_alias
 target_alias
 CMAKE
-WGET
 CC
 CFLAGS
 LDFLAGS
@@ -1299,7 +1300,6 @@ Optional Features:
 
 Some influential environment variables:
   CMAKE       Path to the cmake program
-  WGET        Path to wget program
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
@@ -1857,6 +1857,8 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
+
+
 # Enable/disable stub domains
 
 # Check whether --enable-ioemu-stubdom was given.
@@ -2162,6 +2164,107 @@ extfiles=$ax_cv_extfiles
 
 
 
+# Extract the first word of "wget", so it can be a program name with args.
+set dummy wget; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_WGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $WGET in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_WGET="$WGET" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no"
+  ;;
+esac
+fi
+WGET=$ac_cv_path_WGET
+if test -n "$WGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5
+$as_echo "$WGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"$WGET" != x"no"; then :
+
+    FETCHER="$WGET -c -O"
+
+else
+
+    # Extract the first word of "ftp", so it can be a program name with args.
+set dummy ftp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FTP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $FTP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FTP="$FTP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no"
+  ;;
+esac
+fi
+FTP=$ac_cv_path_FTP
+if test -n "$FTP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5
+$as_echo "$FTP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if test x"$FTP" != x"no"; then :
+
+        FETCHER="$FTP -o"
+
+else
+
+        as_fn_error $? "cannot find wget or ftp" "$LINENO" 5
+
+fi
+
+fi
+
+
 
 # Checks for programs.
 ac_ext=c
@@ -3078,51 +3181,6 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-# Extract the first word of "wget", so it can be a program name with args.
-set dummy wget; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WGET+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $WGET in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_WGET="$WGET" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no"
-  ;;
-esac
-fi
-WGET=$ac_cv_path_WGET
-if test -n "$WGET"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5
-$as_echo "$WGET" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${WGET}" = x"no"
-then
-    as_fn_error $? "Unable to find wget, please install wget" "$LINENO" 5
-fi
 
 # Checks for programs that depend on a feature
 
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index de29fb5..90fc94f 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -13,6 +13,7 @@ m4_include([../m4/stubdom.m4])
 m4_include([../m4/features.m4])
 m4_include([../m4/path_or_fail.m4])
 m4_include([../m4/depends.m4])
+m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
 AX_STUBDOM_DEFAULT_ENABLE([ioemu-stubdom], [ioemu])
@@ -27,13 +28,12 @@ AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of stubdom])
 AX_ARG_DEFAULT_ENABLE([extfiles], [Use xen extfiles repository for libraries])
 
 AC_ARG_VAR([CMAKE], [Path to the cmake program])
-AC_ARG_VAR([WGET], [Path to wget program])
+AX_CHECK_FETCHER
 
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
-AX_PATH_PROG_OR_FAIL([WGET], [wget])
 
 # Checks for programs that depend on a feature
 AX_DEPENDS_PATH_PROG([vtpm], [CMAKE], [cmake])
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12: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 1UiOre-0002sV-0U; Fri, 31 May 2013 12: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 1UiOrc-0002rf-Fn
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:24 +0000
Received: from [85.158.137.99:19329] by server-1.bemta-3.messagelabs.com id
	8B/CD-06847-BBD98A15; Fri, 31 May 2013 12:55:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1370004919!13154550!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20464 invoked from network); 31 May 2013 12:55:20 -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;
	31 May 2013 12:55: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 1UiOrX-0004De-0O
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrW-0004wB-Nu
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:18 +0000
Date: Fri, 31 May 2013 12:55:18 +0000
Message-Id: <E1UiOrW-0004wB-Nu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: Make stubdom buildsystem
	consistent with tools buildsystem
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 1ecd5e015d67837bb094e9e8921dca4e90578f8a
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Mon May 13 10:24:31 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:07:53 2013 +0100

    stubdom: Make stubdom buildsystem consistent with tools buildsystem
    
    Use FETCHER for stubdom, too. This makes stubdom buildsystem
    more consistent with tools buildsystem.
    Fixes toplevel configure failure if wget is not found
    independent if we are going to build stubdom or not.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matt Wilson <msw@amazon.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/Stubdom.mk.in |    2 +-
 stubdom/Makefile     |   18 +++---
 stubdom/configure    |  152 ++++++++++++++++++++++++++++++++++---------------
 stubdom/configure.ac |    4 +-
 4 files changed, 117 insertions(+), 59 deletions(-)

diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index 432efd7..302842e 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -7,7 +7,7 @@ LIBDIR              := $(libdir)
 
 # Path Programs
 CMAKE               := @CMAKE@
-WGET                := @WGET@ -c
+FETCHER             := @FETCHER@
 
 # A debug build of stubdom? //FIXME: Someone make this do something
 debug               := @debug@
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9caccc4..35295f0 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -68,7 +68,7 @@ $(eval $(genpath-target))
 ##############
 
 newlib-$(NEWLIB_VERSION).tar.gz:
-	$(WGET) $(NEWLIB_URL)/$@
+	$(FETCHER) $@ $(NEWLIB_URL)/$@
 
 newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
 	tar xzf $<
@@ -94,7 +94,7 @@ $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
 ############
 
 zlib-$(ZLIB_VERSION).tar.gz:
-	$(WGET) $(ZLIB_URL)/$@
+	$(FETCHER) $@ $(ZLIB_URL)/$@
 
 zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz 
 	tar xzf $<
@@ -114,7 +114,7 @@ $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 ##############
 
 pciutils-$(LIBPCI_VERSION).tar.bz2:
-	$(WGET) $(LIBPCI_URL)/$@
+	$(FETCHER) $@ $(LIBPCI_URL)/$@
 
 pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
 	tar xjf $<
@@ -142,7 +142,7 @@ $(LIBPCI_STAMPFILE): pciutils-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) $(ZLIB_STAM
 ######
 
 lwip-$(LWIP_VERSION).tar.gz:
-	$(WGET) $(LWIP_URL)/$@
+	$(FETCHER) $@ $(LWIP_URL)/$@
 
 lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 	tar xzf $<
@@ -154,7 +154,7 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
 # cross-gmp
 #############
 gmp-$(GMP_VERSION).tar.bz2:
-	$(WGET) $(GMP_URL)/$@
+	$(FETCHER) $@ $(GMP_URL)/$@
 
 .PHONY: cross-gmp
 ifeq ($(XEN_TARGET_ARCH), x86_32)
@@ -180,7 +180,7 @@ $(GMP_STAMPFILE): gmp-$(XEN_TARGET_ARCH)
 # cross-polarssl
 #############
 polarssl-$(POLARSSL_VERSION)-gpl.tgz:
-	$(WGET) $(POLARSSL_URL)/$@
+	$(FETCHER) $@ $(POLARSSL_URL)/$@
 
 polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
 	tar xzf $<
@@ -202,7 +202,7 @@ $(POLARSSL_STAMPFILE): polarssl-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) lwip-$(XE
 # cross-tpmemu
 #############
 tpm_emulator-$(TPMEMU_VERSION).tar.gz:
-	$(WGET) $(TPMEMU_URL)/$@
+	$(FETCHER) $@ $(TPMEMU_URL)/$@
 
 tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	@if [ ! -f "$(CMAKE)" ]; then echo "cmake not installed! Install it and then rerun ./configure!"; false; fi
@@ -232,7 +232,7 @@ CAMLLIB = $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ocaml
 OCAML_STAMPFILE=$(CAMLLIB)/.dirstamp
 
 ocaml-$(OCAML_VERSION).tar.gz:
-	$(WGET) $(OCAML_URL)/$@
+	$(FETCHER) $@ $(OCAML_URL)/$@
 
 ocaml-$(XEN_TARGET_ARCH)/.dirstamp: ocaml-$(OCAML_VERSION).tar.gz ocaml.patch
 	tar xzf $<
@@ -385,7 +385,7 @@ vtpmmgr: cross-polarssl
 ######
 
 grub-$(GRUB_VERSION).tar.gz:
-	$(WGET) $(GRUB_URL)/$@
+	$(FETCHER) $@ $(GRUB_URL)/$@
 
 grub-upstream: grub-$(GRUB_VERSION).tar.gz
 	tar xzf $<
diff --git a/stubdom/configure b/stubdom/configure
index 218457f..de9329f 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -593,6 +593,8 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+FETCHER
+FTP
 WGET
 CMAKE
 extfiles
@@ -657,7 +659,6 @@ enable_extfiles
 host_alias
 target_alias
 CMAKE
-WGET
 CC
 CFLAGS
 LDFLAGS
@@ -1299,7 +1300,6 @@ Optional Features:
 
 Some influential environment variables:
   CMAKE       Path to the cmake program
-  WGET        Path to wget program
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
@@ -1857,6 +1857,8 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
+
+
 # Enable/disable stub domains
 
 # Check whether --enable-ioemu-stubdom was given.
@@ -2162,6 +2164,107 @@ extfiles=$ax_cv_extfiles
 
 
 
+# Extract the first word of "wget", so it can be a program name with args.
+set dummy wget; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_WGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $WGET in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_WGET="$WGET" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no"
+  ;;
+esac
+fi
+WGET=$ac_cv_path_WGET
+if test -n "$WGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5
+$as_echo "$WGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"$WGET" != x"no"; then :
+
+    FETCHER="$WGET -c -O"
+
+else
+
+    # Extract the first word of "ftp", so it can be a program name with args.
+set dummy ftp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FTP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $FTP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FTP="$FTP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no"
+  ;;
+esac
+fi
+FTP=$ac_cv_path_FTP
+if test -n "$FTP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5
+$as_echo "$FTP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if test x"$FTP" != x"no"; then :
+
+        FETCHER="$FTP -o"
+
+else
+
+        as_fn_error $? "cannot find wget or ftp" "$LINENO" 5
+
+fi
+
+fi
+
+
 
 # Checks for programs.
 ac_ext=c
@@ -3078,51 +3181,6 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-# Extract the first word of "wget", so it can be a program name with args.
-set dummy wget; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WGET+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $WGET in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_WGET="$WGET" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no"
-  ;;
-esac
-fi
-WGET=$ac_cv_path_WGET
-if test -n "$WGET"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5
-$as_echo "$WGET" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${WGET}" = x"no"
-then
-    as_fn_error $? "Unable to find wget, please install wget" "$LINENO" 5
-fi
 
 # Checks for programs that depend on a feature
 
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index de29fb5..90fc94f 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -13,6 +13,7 @@ m4_include([../m4/stubdom.m4])
 m4_include([../m4/features.m4])
 m4_include([../m4/path_or_fail.m4])
 m4_include([../m4/depends.m4])
+m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
 AX_STUBDOM_DEFAULT_ENABLE([ioemu-stubdom], [ioemu])
@@ -27,13 +28,12 @@ AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of stubdom])
 AX_ARG_DEFAULT_ENABLE([extfiles], [Use xen extfiles repository for libraries])
 
 AC_ARG_VAR([CMAKE], [Path to the cmake program])
-AC_ARG_VAR([WGET], [Path to wget program])
+AX_CHECK_FETCHER
 
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
-AX_PATH_PROG_OR_FAIL([WGET], [wget])
 
 # Checks for programs that depend on a feature
 AX_DEPENDS_PATH_PROG([vtpm], [CMAKE], [cmake])
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:55: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 1UiOrl-0002vt-41; Fri, 31 May 2013 12:55:33 +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 1UiOrk-0002vD-9Z
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:32 +0000
Received: from [85.158.137.99:19865] by server-12.bemta-3.messagelabs.com id
	DA/F2-17342-3CD98A15; Fri, 31 May 2013 12:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1370004929!479939!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15644 invoked from network); 31 May 2013 12:55:30 -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;
	31 May 2013 12:55: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 1UiOrh-0004Dm-93
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrh-0004x3-7G
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:29 +0000
Date: Fri, 31 May 2013 12:55:29 +0000
Message-Id: <E1UiOrh-0004x3-7G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Return an error if an empty file
	is passed to cd-insert
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 121dac93afd2f600485618d9b493892e2fca8fa8
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Tue May 14 11:07:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:10:51 2013 +0100

    xl: Return an error if an empty file is passed to cd-insert
    
    Two changes:
    * Stat the file before calling libxl_cdrom_insert()
    * Return an error if anything fails (including libxl_cdrom_insert)
    
    This is in part to work around the fact that the RAW disk type
    is used for things that aren't actually files; so we can't call
    stat in libxl_device.c:libxl__device_disk_set_backend() because
    it may be going over a remote protocol.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index e13a64e..c5292f4 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2505,25 +2505,45 @@ int main_memset(int argc, char **argv)
     return 0;
 }
 
-static void cd_insert(uint32_t domid, const char *virtdev, char *phys)
+static int cd_insert(uint32_t domid, const char *virtdev, char *phys)
 {
     libxl_device_disk disk; /* we don't free disk's contents */
     char *buf = NULL;
     XLU_Config *config = 0;
+    struct stat b;
+    int rc = 0;
 
 
     if (asprintf(&buf, "vdev=%s,access=r,devtype=cdrom,target=%s",
                  virtdev, phys ? phys : "") < 0) {
         fprintf(stderr, "out of memory\n");
-        return;
+        rc = 1;
+        goto out;
     }
 
     parse_disk_config(&config, buf, &disk);
 
-    libxl_cdrom_insert(ctx, domid, &disk, NULL);
+    /* ATM the existence of the backing file is not checked for qdisk
+     * in libxl_cdrom_insert() because RAW is used for remote
+     * protocols as well as plain files.  This will ideally be changed
+     * for 4.4, but this work-around fixes the problem of "cd-insert"
+     * returning success for non-existent files. */
+    if (disk.format != LIBXL_DISK_FORMAT_EMPTY
+        && stat(disk.pdev_path, &b)) {
+        fprintf(stderr, "Cannot stat file: %s\n",
+                disk.pdev_path);
+        rc = 1;
+        goto out;
+    }
+
+    if (libxl_cdrom_insert(ctx, domid, &disk, NULL))
+        rc=1;
 
+out:
     libxl_device_disk_dispose(&disk);
     free(buf);
+
+    return rc;
 }
 
 int main_cd_eject(int argc, char **argv)
@@ -2539,8 +2559,7 @@ int main_cd_eject(int argc, char **argv)
     domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
 
-    cd_insert(domid, virtdev, NULL);
-    return 0;
+    return cd_insert(domid, virtdev, NULL);
 }
 
 int main_cd_insert(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:55: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 1UiOrl-0002vt-41; Fri, 31 May 2013 12:55:33 +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 1UiOrk-0002vD-9Z
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:32 +0000
Received: from [85.158.137.99:19865] by server-12.bemta-3.messagelabs.com id
	DA/F2-17342-3CD98A15; Fri, 31 May 2013 12:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1370004929!479939!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15644 invoked from network); 31 May 2013 12:55:30 -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;
	31 May 2013 12:55: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 1UiOrh-0004Dm-93
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrh-0004x3-7G
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:29 +0000
Date: Fri, 31 May 2013 12:55:29 +0000
Message-Id: <E1UiOrh-0004x3-7G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Return an error if an empty file
	is passed to cd-insert
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 121dac93afd2f600485618d9b493892e2fca8fa8
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Tue May 14 11:07:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:10:51 2013 +0100

    xl: Return an error if an empty file is passed to cd-insert
    
    Two changes:
    * Stat the file before calling libxl_cdrom_insert()
    * Return an error if anything fails (including libxl_cdrom_insert)
    
    This is in part to work around the fact that the RAW disk type
    is used for things that aren't actually files; so we can't call
    stat in libxl_device.c:libxl__device_disk_set_backend() because
    it may be going over a remote protocol.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index e13a64e..c5292f4 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2505,25 +2505,45 @@ int main_memset(int argc, char **argv)
     return 0;
 }
 
-static void cd_insert(uint32_t domid, const char *virtdev, char *phys)
+static int cd_insert(uint32_t domid, const char *virtdev, char *phys)
 {
     libxl_device_disk disk; /* we don't free disk's contents */
     char *buf = NULL;
     XLU_Config *config = 0;
+    struct stat b;
+    int rc = 0;
 
 
     if (asprintf(&buf, "vdev=%s,access=r,devtype=cdrom,target=%s",
                  virtdev, phys ? phys : "") < 0) {
         fprintf(stderr, "out of memory\n");
-        return;
+        rc = 1;
+        goto out;
     }
 
     parse_disk_config(&config, buf, &disk);
 
-    libxl_cdrom_insert(ctx, domid, &disk, NULL);
+    /* ATM the existence of the backing file is not checked for qdisk
+     * in libxl_cdrom_insert() because RAW is used for remote
+     * protocols as well as plain files.  This will ideally be changed
+     * for 4.4, but this work-around fixes the problem of "cd-insert"
+     * returning success for non-existent files. */
+    if (disk.format != LIBXL_DISK_FORMAT_EMPTY
+        && stat(disk.pdev_path, &b)) {
+        fprintf(stderr, "Cannot stat file: %s\n",
+                disk.pdev_path);
+        rc = 1;
+        goto out;
+    }
+
+    if (libxl_cdrom_insert(ctx, domid, &disk, NULL))
+        rc=1;
 
+out:
     libxl_device_disk_dispose(&disk);
     free(buf);
+
+    return rc;
 }
 
 int main_cd_eject(int argc, char **argv)
@@ -2539,8 +2559,7 @@ int main_cd_eject(int argc, char **argv)
     domid = find_domain(argv[optind]);
     virtdev = argv[optind + 1];
 
-    cd_insert(domid, virtdev, NULL);
-    return 0;
+    return cd_insert(domid, virtdev, NULL);
 }
 
 int main_cd_insert(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:55: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 1UiOs6-00033Y-7h; Fri, 31 May 2013 12:55: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 1UiOs5-000331-Br
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:53 +0000
Received: from [85.158.139.83:3873] by server-4.bemta-5.messagelabs.com id
	C5/14-12332-8DD98A15; Fri, 31 May 2013 12:55:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1370004950!29394208!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25533 invoked from network); 31 May 2013 12:55:51 -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;
	31 May 2013 12:55: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 1UiOs2-0004E1-4U
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOs2-0004xp-2x
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:50 +0000
Date: Fri, 31 May 2013 12:55:50 +0000
Message-Id: <E1UiOs2-0004xp-2x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: check string format for
	early_printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 54353cae096c19f176417f6d425de0a0f8a71228
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 23 16:05:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:15:25 2013 +0100

    xen/arm: check string format for early_printk
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/early_printk.h |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index b72fce7..03ead23 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -14,13 +14,19 @@
 
 #ifdef EARLY_PRINTK
 
-void early_printk(const char *fmt, ...);
-void early_panic(const char *fmt, ...) __attribute__((noreturn));
+void early_printk(const char *fmt, ...)
+    __attribute__((format (printf, 1, 2)));
+void early_panic(const char *fmt, ...) __attribute__((noreturn))
+    __attribute__((format (printf, 1, 2)));
 
 #else
 
-static inline void early_printk(const char *fmt, ...) {}
-static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...) {while(1);}
+static inline void early_printk(const char *fmt, ...)
+    __attribute__((format (printf, 1, 2)))
+{}
+static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...)
+    __attribute__((format (printf, 1, 2)))
+{while(1);}
 
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:55: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 1UiOs6-00033Y-7h; Fri, 31 May 2013 12:55: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 1UiOs5-000331-Br
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:53 +0000
Received: from [85.158.139.83:3873] by server-4.bemta-5.messagelabs.com id
	C5/14-12332-8DD98A15; Fri, 31 May 2013 12:55:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1370004950!29394208!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25533 invoked from network); 31 May 2013 12:55:51 -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;
	31 May 2013 12:55: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 1UiOs2-0004E1-4U
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOs2-0004xp-2x
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:50 +0000
Date: Fri, 31 May 2013 12:55:50 +0000
Message-Id: <E1UiOs2-0004xp-2x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: check string format for
	early_printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 54353cae096c19f176417f6d425de0a0f8a71228
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 23 16:05:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:15:25 2013 +0100

    xen/arm: check string format for early_printk
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/early_printk.h |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index b72fce7..03ead23 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -14,13 +14,19 @@
 
 #ifdef EARLY_PRINTK
 
-void early_printk(const char *fmt, ...);
-void early_panic(const char *fmt, ...) __attribute__((noreturn));
+void early_printk(const char *fmt, ...)
+    __attribute__((format (printf, 1, 2)));
+void early_panic(const char *fmt, ...) __attribute__((noreturn))
+    __attribute__((format (printf, 1, 2)));
 
 #else
 
-static inline void early_printk(const char *fmt, ...) {}
-static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...) {while(1);}
+static inline void early_printk(const char *fmt, ...)
+    __attribute__((format (printf, 1, 2)))
+{}
+static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...)
+    __attribute__((format (printf, 1, 2)))
+{while(1);}
 
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:55: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 1UiOs9-00034s-Af; Fri, 31 May 2013 12:55:57 +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 1UiOs7-000344-Vf
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:56 +0000
Received: from [85.158.139.83:64124] by server-9.bemta-5.messagelabs.com id
	C3/51-14875-ADD98A15; Fri, 31 May 2013 12:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1370004940!29853562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14232 invoked from network); 31 May 2013 12:55:41 -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;
	31 May 2013 12:55: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 1UiOrr-0004Ds-Gj
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrr-0004xT-Dy
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:39 +0000
Date: Fri, 31 May 2013 12:55:39 +0000
Message-Id: <E1UiOrr-0004xT-Dy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: avoid lost characters with
	early_printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cafdceb66e154f1ac204be935f9030959827bd1f
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 23 15:50:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:14:48 2013 +0100

    xen/arm: avoid lost characters with early_printk
    
    Introduce the function early_flush to wait until the UART has finished to
    transfer the character.
    When early printk is enabled, it's possible to loose the last characters if:
        - the UART is initialized by the UART driver
        - Xen hang
    
    This is result to a truncated message. To be sure that the message is fully
    transfered by early_printk, add a call to early_flush. This will avoid lost
    characters.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/debug.S  |    7 +++++++
 xen/arch/arm/arm64/debug.S  |    7 +++++++
 xen/arch/arm/early_printk.c |    7 +++++++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/arm32/debug.S b/xen/arch/arm/arm32/debug.S
index 1bfbfc1..92f5724 100644
--- a/xen/arch/arm/arm32/debug.S
+++ b/xen/arch/arm/arm32/debug.S
@@ -32,6 +32,13 @@ early_putch:
         early_uart_transmit r1, r0
         mov   pc, lr
 
+.globl early_flush
+/* Flush the UART - this function is called by C */
+early_flush:
+        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* r1 := VA UART base address */
+        early_uart_ready r1, r2
+        mov   pc, lr
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
index 38b7c74..c7b5e6c 100644
--- a/xen/arch/arm/arm64/debug.S
+++ b/xen/arch/arm/arm64/debug.S
@@ -32,6 +32,13 @@ early_putch:
         early_uart_transmit x15, w0
         ret
 
+.globl early_flush
+/* Flush the UART - this function is called by C */
+early_flush:
+        ldr   x15, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* x15 := VA UART base address */
+        early_uart_ready x15, 1
+        ret
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 5950323..ca151a5 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -16,6 +16,7 @@
 #include <asm/early_printk.h>
 
 void early_putch(char c);
+void early_flush(void);
 
 /* Early printk buffer */
 static char __initdata buf[512];
@@ -34,6 +35,12 @@ static void __init early_vprintk(const char *fmt, va_list args)
 {
     vsnprintf(buf, sizeof(buf), fmt, args);
     early_puts(buf);
+
+    /*
+     * Wait the UART has finished to transfer all characters before
+     * to continue. This will avoid lost characters if Xen abort.
+     */
+    early_flush();
 }
 
 void __init early_printk(const char *fmt, ...)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:55: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 1UiOs9-00034s-Af; Fri, 31 May 2013 12:55:57 +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 1UiOs7-000344-Vf
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:56 +0000
Received: from [85.158.139.83:64124] by server-9.bemta-5.messagelabs.com id
	C3/51-14875-ADD98A15; Fri, 31 May 2013 12:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1370004940!29853562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14232 invoked from network); 31 May 2013 12:55:41 -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;
	31 May 2013 12:55: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 1UiOrr-0004Ds-Gj
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOrr-0004xT-Dy
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:55:39 +0000
Date: Fri, 31 May 2013 12:55:39 +0000
Message-Id: <E1UiOrr-0004xT-Dy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: avoid lost characters with
	early_printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cafdceb66e154f1ac204be935f9030959827bd1f
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu May 23 15:50:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:14:48 2013 +0100

    xen/arm: avoid lost characters with early_printk
    
    Introduce the function early_flush to wait until the UART has finished to
    transfer the character.
    When early printk is enabled, it's possible to loose the last characters if:
        - the UART is initialized by the UART driver
        - Xen hang
    
    This is result to a truncated message. To be sure that the message is fully
    transfered by early_printk, add a call to early_flush. This will avoid lost
    characters.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/debug.S  |    7 +++++++
 xen/arch/arm/arm64/debug.S  |    7 +++++++
 xen/arch/arm/early_printk.c |    7 +++++++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/arm32/debug.S b/xen/arch/arm/arm32/debug.S
index 1bfbfc1..92f5724 100644
--- a/xen/arch/arm/arm32/debug.S
+++ b/xen/arch/arm/arm32/debug.S
@@ -32,6 +32,13 @@ early_putch:
         early_uart_transmit r1, r0
         mov   pc, lr
 
+.globl early_flush
+/* Flush the UART - this function is called by C */
+early_flush:
+        ldr   r1, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* r1 := VA UART base address */
+        early_uart_ready r1, r2
+        mov   pc, lr
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/arm64/debug.S b/xen/arch/arm/arm64/debug.S
index 38b7c74..c7b5e6c 100644
--- a/xen/arch/arm/arm64/debug.S
+++ b/xen/arch/arm/arm64/debug.S
@@ -32,6 +32,13 @@ early_putch:
         early_uart_transmit x15, w0
         ret
 
+.globl early_flush
+/* Flush the UART - this function is called by C */
+early_flush:
+        ldr   x15, =FIXMAP_ADDR(FIXMAP_CONSOLE)  /* x15 := VA UART base address */
+        early_uart_ready x15, 1
+        ret
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 5950323..ca151a5 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -16,6 +16,7 @@
 #include <asm/early_printk.h>
 
 void early_putch(char c);
+void early_flush(void);
 
 /* Early printk buffer */
 static char __initdata buf[512];
@@ -34,6 +35,12 @@ static void __init early_vprintk(const char *fmt, va_list args)
 {
     vsnprintf(buf, sizeof(buf), fmt, args);
     early_puts(buf);
+
+    /*
+     * Wait the UART has finished to transfer all characters before
+     * to continue. This will avoid lost characters if Xen abort.
+     */
+    early_flush();
 }
 
 void __init early_printk(const char *fmt, ...)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOsG-00037b-Dj; Fri, 31 May 2013 12:56:04 +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 1UiOsF-00036w-2b
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:03 +0000
Received: from [85.158.143.99:3073] by server-2.bemta-4.messagelabs.com id
	E0/FF-27124-2ED98A15; Fri, 31 May 2013 12:56:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1370004960!27591074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6032 invoked from network); 31 May 2013 12:56:01 -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;
	31 May 2013 12:56: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 1UiOsC-0004EA-AP
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsC-0004yB-8b
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:00 +0000
Date: Fri, 31 May 2013 12:56:00 +0000
Message-Id: <E1UiOsC-0004yB-8b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: calculate baud rate
	divisor from user provided value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b68346247f74e002ef180403167888a03f488080
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:26 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:10 2013 +0100

    arm/early-printk: calculate baud rate divisor from user provided value
    
    For early-printk the used baud rate was hardcoded in the code, using
    precalculated divisor values.
    Let the calculation of these values be done by the preprocessor and
    use a human readable value in xen/arch/arm/Rules.mk to drive this.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt          |    3 +++
 xen/arch/arm/Rules.mk                   |    3 +++
 xen/arch/arm/arm32/debug-exynos4210.inc |    4 ++--
 xen/arch/arm/arm32/debug-pl011.inc      |    4 ++--
 xen/arch/arm/arm64/debug-pl011.inc      |    4 ++--
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index d5cae85..10c3053 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -12,4 +12,7 @@ where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
 
+The baud rate is hardcoded in xen/arch/arm/Rules.mk,
+see there when adding support for new machines.
+
 By default early printk is disabled.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index b6a6890..b4d6907 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -45,9 +45,11 @@ ifeq ($(debug),y)
 # TODO handle UART base address from make command line
 ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
 EARLY_PRINTK_INC := pl011
+EARLY_PRINTK_BAUD := 38400
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
+EARLY_PRINTK_BAUD := 115200
 endif
 
 ifneq ($(EARLY_PRINTK_INC),)
@@ -56,4 +58,5 @@ endif
 
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
 endif
diff --git a/xen/arch/arm/arm32/debug-exynos4210.inc b/xen/arch/arm/arm32/debug-exynos4210.inc
index 4241640..4922148 100644
--- a/xen/arch/arm/arm32/debug-exynos4210.inc
+++ b/xen/arch/arm/arm32/debug-exynos4210.inc
@@ -38,9 +38,9 @@
         orr   \rd, \rd, #(0x7<<8)
         str   \rd, [\rc, #0x558]
 
-        mov   \rc, #4
+        mov   \rc, #(100000000 / EARLY_PRINTK_BAUD % 16)
         str   \rc, [\rb, #UFRACVAL]     /* -> UFRACVAL (Baud divisor fraction) */
-        mov   \rc, #53
+        mov   \rc, #(100000000 / EARLY_PRINTK_BAUD / 16 - 1)
         str   \rc, [\rb, #UBRDIV]       /* -> UBRDIV (Baud divisor integer) */
         mov   \rc, #3                   /* 8n1 */
         str   \rc, [\rb, #ULCON]        /* -> (Line control) */
diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc
index 6954aeb..2d970ea 100644
--- a/xen/arch/arm/arm32/debug-pl011.inc
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -23,9 +23,9 @@
  * rc: scratch register 1
  * rd: scratch register 2 (unused here) */
 .macro early_uart_init rb, rc, rd
-        mov   \rc, #0x0
+        mov   \rc, #(7372800 / EARLY_PRINTK_BAUD % 16)
         str   \rc, [\rb, #0x28]     /* -> UARTFBRD (Baud divisor fraction) */
-        mov   \rc, #0x4             /* 7.3728MHz / 0x4 == 16 * 115200 */
+        mov   \rc, #(7372800 / EARLY_PRINTK_BAUD / 16)
         str   \rc, [\rb, #0x24]     /* -> UARTIBRD (Baud divisor integer) */
         mov   \rc, #0x60            /* 8n1 */
         str   \rc, [\rb, #0x2C]     /* -> UARTLCR_H (Line control) */
diff --git a/xen/arch/arm/arm64/debug-pl011.inc b/xen/arch/arm/arm64/debug-pl011.inc
index ee6e0e0..7220940 100644
--- a/xen/arch/arm/arm64/debug-pl011.inc
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -24,9 +24,9 @@
  * xb: register which containts the UART base address
  * c: scratch register number */
 .macro early_uart_init xb, c
-        mov   x\c, #0x0
+        mov   x\c, #(7372800 / EARLY_PRINTK_BAUD % 16)
         strh  w\c, [\xb, #0x28]      /* -> UARTFBRD (Baud divisor fraction) */
-        mov   x\c, #0x4              /* 7.3728MHz / 0x4 == 16 * 115200 */
+        mov   x\c, #(7372800 / EARLY_PRINTK_BAUD / 16)
         strh  w\c, [\xb, #0x24]      /* -> UARTIBRD (Baud divisor integer) */
         mov   x\c, #0x60             /* 8n1 */
         str   w\c, [\xb, #0x2C]      /* -> UARTLCR_H (Line control) */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOsG-00037b-Dj; Fri, 31 May 2013 12:56:04 +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 1UiOsF-00036w-2b
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:03 +0000
Received: from [85.158.143.99:3073] by server-2.bemta-4.messagelabs.com id
	E0/FF-27124-2ED98A15; Fri, 31 May 2013 12:56:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1370004960!27591074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6032 invoked from network); 31 May 2013 12:56:01 -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;
	31 May 2013 12:56: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 1UiOsC-0004EA-AP
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsC-0004yB-8b
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:00 +0000
Date: Fri, 31 May 2013 12:56:00 +0000
Message-Id: <E1UiOsC-0004yB-8b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: calculate baud rate
	divisor from user provided value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 b68346247f74e002ef180403167888a03f488080
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:26 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:10 2013 +0100

    arm/early-printk: calculate baud rate divisor from user provided value
    
    For early-printk the used baud rate was hardcoded in the code, using
    precalculated divisor values.
    Let the calculation of these values be done by the preprocessor and
    use a human readable value in xen/arch/arm/Rules.mk to drive this.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt          |    3 +++
 xen/arch/arm/Rules.mk                   |    3 +++
 xen/arch/arm/arm32/debug-exynos4210.inc |    4 ++--
 xen/arch/arm/arm32/debug-pl011.inc      |    4 ++--
 xen/arch/arm/arm64/debug-pl011.inc      |    4 ++--
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index d5cae85..10c3053 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -12,4 +12,7 @@ where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
 
+The baud rate is hardcoded in xen/arch/arm/Rules.mk,
+see there when adding support for new machines.
+
 By default early printk is disabled.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index b6a6890..b4d6907 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -45,9 +45,11 @@ ifeq ($(debug),y)
 # TODO handle UART base address from make command line
 ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
 EARLY_PRINTK_INC := pl011
+EARLY_PRINTK_BAUD := 38400
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
+EARLY_PRINTK_BAUD := 115200
 endif
 
 ifneq ($(EARLY_PRINTK_INC),)
@@ -56,4 +58,5 @@ endif
 
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
 endif
diff --git a/xen/arch/arm/arm32/debug-exynos4210.inc b/xen/arch/arm/arm32/debug-exynos4210.inc
index 4241640..4922148 100644
--- a/xen/arch/arm/arm32/debug-exynos4210.inc
+++ b/xen/arch/arm/arm32/debug-exynos4210.inc
@@ -38,9 +38,9 @@
         orr   \rd, \rd, #(0x7<<8)
         str   \rd, [\rc, #0x558]
 
-        mov   \rc, #4
+        mov   \rc, #(100000000 / EARLY_PRINTK_BAUD % 16)
         str   \rc, [\rb, #UFRACVAL]     /* -> UFRACVAL (Baud divisor fraction) */
-        mov   \rc, #53
+        mov   \rc, #(100000000 / EARLY_PRINTK_BAUD / 16 - 1)
         str   \rc, [\rb, #UBRDIV]       /* -> UBRDIV (Baud divisor integer) */
         mov   \rc, #3                   /* 8n1 */
         str   \rc, [\rb, #ULCON]        /* -> (Line control) */
diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc
index 6954aeb..2d970ea 100644
--- a/xen/arch/arm/arm32/debug-pl011.inc
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -23,9 +23,9 @@
  * rc: scratch register 1
  * rd: scratch register 2 (unused here) */
 .macro early_uart_init rb, rc, rd
-        mov   \rc, #0x0
+        mov   \rc, #(7372800 / EARLY_PRINTK_BAUD % 16)
         str   \rc, [\rb, #0x28]     /* -> UARTFBRD (Baud divisor fraction) */
-        mov   \rc, #0x4             /* 7.3728MHz / 0x4 == 16 * 115200 */
+        mov   \rc, #(7372800 / EARLY_PRINTK_BAUD / 16)
         str   \rc, [\rb, #0x24]     /* -> UARTIBRD (Baud divisor integer) */
         mov   \rc, #0x60            /* 8n1 */
         str   \rc, [\rb, #0x2C]     /* -> UARTLCR_H (Line control) */
diff --git a/xen/arch/arm/arm64/debug-pl011.inc b/xen/arch/arm/arm64/debug-pl011.inc
index ee6e0e0..7220940 100644
--- a/xen/arch/arm/arm64/debug-pl011.inc
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -24,9 +24,9 @@
  * xb: register which containts the UART base address
  * c: scratch register number */
 .macro early_uart_init xb, c
-        mov   x\c, #0x0
+        mov   x\c, #(7372800 / EARLY_PRINTK_BAUD % 16)
         strh  w\c, [\xb, #0x28]      /* -> UARTFBRD (Baud divisor fraction) */
-        mov   x\c, #0x4              /* 7.3728MHz / 0x4 == 16 * 115200 */
+        mov   x\c, #(7372800 / EARLY_PRINTK_BAUD / 16)
         strh  w\c, [\xb, #0x24]      /* -> UARTIBRD (Baud divisor integer) */
         mov   x\c, #0x60             /* 8n1 */
         str   w\c, [\xb, #0x2C]      /* -> UARTLCR_H (Line control) */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOsT-0003BO-JC; Fri, 31 May 2013 12:56: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 1UiOsS-0003B2-Hj
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:16 +0000
Received: from [85.158.139.211:35273] by server-9.bemta-5.messagelabs.com id
	44/32-14875-FED98A15; Fri, 31 May 2013 12:56:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1370004970!19406403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10432 invoked from network); 31 May 2013 12:56:11 -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;
	31 May 2013 12:56: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 1UiOsM-0004Ep-GN
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsM-0004yZ-FF
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:10 +0000
Date: Fri, 31 May 2013 12:56:10 +0000
Message-Id: <E1UiOsM-0004yZ-FF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: allow skipping of
	UART 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 130645eee340608c12b632535d3f983508348ba1
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:27 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:29 2013 +0100

    arm/early-printk: allow skipping of UART init
    
    While it seems obvious to initialize the UART before using it, chances
    are that some firmware code or the bootloader already did this.
    So it may actually be a good idea to skip the initialization, in fact
    this fixes early printk on my TC2 Versatile Express.
    So provide an option in xen/arch/arm/Rules.mk to only initialize the
    UART when needed.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt |    4 ++++
 xen/arch/arm/Rules.mk          |    2 ++
 xen/arch/arm/arm32/head.S      |    2 ++
 xen/arch/arm/arm64/head.S      |    2 ++
 4 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 10c3053..965add5 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -14,5 +14,9 @@ where mach is the name of the machine:
 
 The baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
+If not explicitly requested with "EARLY_PRINTK_INIT_UART := y" in Rules.mk,
+the code will not try to initialize the UART, so that bootloader or
+firmware settings can be used for maximum compatibility. The baud rate
+parameter is ignored in this case.
 
 By default early printk is disabled.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index b4d6907..fdcf73e 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -49,6 +49,7 @@ EARLY_PRINTK_BAUD := 38400
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
+EARLY_PRINTK_INIT_UART := y
 EARLY_PRINTK_BAUD := 115200
 endif
 
@@ -57,6 +58,7 @@ EARLY_PRINTK := y
 endif
 
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
+CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
 endif
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index ec7f640..0588d54 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -369,7 +369,9 @@ fail:   PRINT("- Boot failed -\r\n")
  * r11: Early UART base address
  * Clobbers r0-r2 */
 init_uart:
+#ifdef EARLY_PRINTK_INIT_UART
         early_uart_init r11, r1, r2
+#endif
         adr   r0, 1f
         b     puts                  /* Jump to puts */
 1:      .asciz "- UART enabled -\r\n"
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 8955946..21b7e4d 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -116,7 +116,9 @@ boot_cpu:
 #ifdef EARLY_PRINTK
         ldr   x23, =EARLY_UART_BASE_ADDRESS /* x23 := UART base address */
         cbnz  x22, 1f
+#ifdef EARLY_PRINTK_INIT_UART
         bl    init_uart                 /* CPU 0 sets up the UART too */
+#endif
 1:      PRINT("- CPU ")
         mov   x0, x22
         bl    putn
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOsT-0003BO-JC; Fri, 31 May 2013 12:56: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 1UiOsS-0003B2-Hj
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:16 +0000
Received: from [85.158.139.211:35273] by server-9.bemta-5.messagelabs.com id
	44/32-14875-FED98A15; Fri, 31 May 2013 12:56:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1370004970!19406403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10432 invoked from network); 31 May 2013 12:56:11 -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;
	31 May 2013 12:56: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 1UiOsM-0004Ep-GN
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsM-0004yZ-FF
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:10 +0000
Date: Fri, 31 May 2013 12:56:10 +0000
Message-Id: <E1UiOsM-0004yZ-FF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: allow skipping of
	UART 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 130645eee340608c12b632535d3f983508348ba1
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:27 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:29 2013 +0100

    arm/early-printk: allow skipping of UART init
    
    While it seems obvious to initialize the UART before using it, chances
    are that some firmware code or the bootloader already did this.
    So it may actually be a good idea to skip the initialization, in fact
    this fixes early printk on my TC2 Versatile Express.
    So provide an option in xen/arch/arm/Rules.mk to only initialize the
    UART when needed.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt |    4 ++++
 xen/arch/arm/Rules.mk          |    2 ++
 xen/arch/arm/arm32/head.S      |    2 ++
 xen/arch/arm/arm64/head.S      |    2 ++
 4 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 10c3053..965add5 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -14,5 +14,9 @@ where mach is the name of the machine:
 
 The baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
+If not explicitly requested with "EARLY_PRINTK_INIT_UART := y" in Rules.mk,
+the code will not try to initialize the UART, so that bootloader or
+firmware settings can be used for maximum compatibility. The baud rate
+parameter is ignored in this case.
 
 By default early printk is disabled.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index b4d6907..fdcf73e 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -49,6 +49,7 @@ EARLY_PRINTK_BAUD := 38400
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
+EARLY_PRINTK_INIT_UART := y
 EARLY_PRINTK_BAUD := 115200
 endif
 
@@ -57,6 +58,7 @@ EARLY_PRINTK := y
 endif
 
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
+CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
 endif
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index ec7f640..0588d54 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -369,7 +369,9 @@ fail:   PRINT("- Boot failed -\r\n")
  * r11: Early UART base address
  * Clobbers r0-r2 */
 init_uart:
+#ifdef EARLY_PRINTK_INIT_UART
         early_uart_init r11, r1, r2
+#endif
         adr   r0, 1f
         b     puts                  /* Jump to puts */
 1:      .asciz "- UART enabled -\r\n"
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 8955946..21b7e4d 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -116,7 +116,9 @@ boot_cpu:
 #ifdef EARLY_PRINTK
         ldr   x23, =EARLY_UART_BASE_ADDRESS /* x23 := UART base address */
         cbnz  x22, 1f
+#ifdef EARLY_PRINTK_INIT_UART
         bl    init_uart                 /* CPU 0 sets up the UART too */
+#endif
 1:      PRINT("- CPU ")
         mov   x0, x22
         bl    putn
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UiOsk-0003GB-MN; Fri, 31 May 2013 12:56:34 +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 1UiOsj-0003Fp-QV
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:34 +0000
Received: from [85.158.137.99:35489] by server-4.bemta-3.messagelabs.com id
	A1/CA-01776-10E98A15; Fri, 31 May 2013 12:56:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1370004991!14474458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17139 invoked from network); 31 May 2013 12:56:32 -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;
	31 May 2013 12:56: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 1UiOsg-0004F3-S1
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsg-000503-Ps
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:30 +0000
Date: Fri, 31 May 2013 12:56:30 +0000
Message-Id: <E1UiOsg-000503-Ps@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: add support for ARM
	Fastmodel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 95ac742a2d1b471a5552a2d79b501aff5965efd2
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:29 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:37 2013 +0100

    arm/early-printk: add support for ARM Fastmodel
    
    Though the ARM Fastmodel software emulator mimics a Versatile Express
    board, the boot process is different compared to the real hardware,
    so the early printk differs slightly. Create a new early-printk
    target to model this correctly.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt |    1 +
 xen/arch/arm/Rules.mk          |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 9220113..e423cc4 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -11,6 +11,7 @@ CONFIG_EARLY_PRINTK=mach
 where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
+  - fastmodel: printk on ARM Fastmodel software emulators
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 902bddb..d010c69 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -47,6 +47,12 @@ EARLY_PRINTK_INC := pl011
 EARLY_PRINTK_BAUD := 38400
 EARLY_UART_BASE_ADDRESS := 0x1c090000
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), fastmodel)
+EARLY_PRINTK_INC := pl011
+EARLY_PRINTK_INIT_UART := y
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0x1c090000
+endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
 EARLY_PRINTK_INIT_UART := y
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UiOsk-0003GB-MN; Fri, 31 May 2013 12:56:34 +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 1UiOsj-0003Fp-QV
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:34 +0000
Received: from [85.158.137.99:35489] by server-4.bemta-3.messagelabs.com id
	A1/CA-01776-10E98A15; Fri, 31 May 2013 12:56:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1370004991!14474458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17139 invoked from network); 31 May 2013 12:56:32 -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;
	31 May 2013 12:56: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 1UiOsg-0004F3-S1
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsg-000503-Ps
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:30 +0000
Date: Fri, 31 May 2013 12:56:30 +0000
Message-Id: <E1UiOsg-000503-Ps@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: add support for ARM
	Fastmodel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 95ac742a2d1b471a5552a2d79b501aff5965efd2
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:29 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:37 2013 +0100

    arm/early-printk: add support for ARM Fastmodel
    
    Though the ARM Fastmodel software emulator mimics a Versatile Express
    board, the boot process is different compared to the real hardware,
    so the early printk differs slightly. Create a new early-printk
    target to model this correctly.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt |    1 +
 xen/arch/arm/Rules.mk          |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 9220113..e423cc4 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -11,6 +11,7 @@ CONFIG_EARLY_PRINTK=mach
 where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
+  - fastmodel: printk on ARM Fastmodel software emulators
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 902bddb..d010c69 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -47,6 +47,12 @@ EARLY_PRINTK_INC := pl011
 EARLY_PRINTK_BAUD := 38400
 EARLY_UART_BASE_ADDRESS := 0x1c090000
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), fastmodel)
+EARLY_PRINTK_INC := pl011
+EARLY_PRINTK_INIT_UART := y
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0x1c090000
+endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
 EARLY_PRINTK_INIT_UART := y
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOsu-0003Ij-Pa; Fri, 31 May 2013 12:56:44 +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 1UiOst-0003IT-PR
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:44 +0000
Received: from [85.158.138.51:3394] by server-14.bemta-3.messagelabs.com id
	E2/A6-20016-B0E98A15; Fri, 31 May 2013 12:56:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1370005001!23734562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21531 invoked from network); 31 May 2013 12:56:42 -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;
	31 May 2013 12:56: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 1UiOsr-0004F9-1V
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsq-00050S-Vn
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:41 +0000
Date: Fri, 31 May 2013 12:56:40 +0000
Message-Id: <E1UiOsq-00050S-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: add Calxeda Midway
	UART 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 b339d34409a8d2c1083e2c362ef14c8fdcd81106
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:30 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:41 2013 +0100

    arm/early-printk: add Calxeda Midway UART support
    
    With the help of the previous patches add a stanza to
    xen/arch/arm/Rules.mk to specify the UART configuration of the
    Calxeda Midway machine.
    The information has been taken from the Linux kernel's .dts file.
    This can be enabled by adding "CONFIG_EARLY_PRINTK=midway" to
    Config.mk.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt |    1 +
 xen/arch/arm/Rules.mk          |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index e423cc4..fbc3208 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -11,6 +11,7 @@ CONFIG_EARLY_PRINTK=mach
 where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
+  - midway: printk with the pl011 on Calxeda Midway processors
   - fastmodel: printk on ARM Fastmodel software emulators
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index d010c69..422ed04 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -59,6 +59,11 @@ EARLY_PRINTK_INIT_UART := y
 EARLY_PRINTK_BAUD := 115200
 EARLY_UART_BASE_ADDRESS := 0x12c20000
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), midway)
+EARLY_PRINTK_INC := pl011
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0xfff36000
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOsu-0003Ij-Pa; Fri, 31 May 2013 12:56:44 +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 1UiOst-0003IT-PR
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:44 +0000
Received: from [85.158.138.51:3394] by server-14.bemta-3.messagelabs.com id
	E2/A6-20016-B0E98A15; Fri, 31 May 2013 12:56:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1370005001!23734562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21531 invoked from network); 31 May 2013 12:56:42 -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;
	31 May 2013 12:56: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 1UiOsr-0004F9-1V
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsq-00050S-Vn
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:41 +0000
Date: Fri, 31 May 2013 12:56:40 +0000
Message-Id: <E1UiOsq-00050S-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: add Calxeda Midway
	UART 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 b339d34409a8d2c1083e2c362ef14c8fdcd81106
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:30 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:41 2013 +0100

    arm/early-printk: add Calxeda Midway UART support
    
    With the help of the previous patches add a stanza to
    xen/arch/arm/Rules.mk to specify the UART configuration of the
    Calxeda Midway machine.
    The information has been taken from the Linux kernel's .dts file.
    This can be enabled by adding "CONFIG_EARLY_PRINTK=midway" to
    Config.mk.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt |    1 +
 xen/arch/arm/Rules.mk          |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index e423cc4..fbc3208 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -11,6 +11,7 @@ CONFIG_EARLY_PRINTK=mach
 where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
+  - midway: printk with the pl011 on Calxeda Midway processors
   - fastmodel: printk on ARM Fastmodel software emulators
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index d010c69..422ed04 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -59,6 +59,11 @@ EARLY_PRINTK_INIT_UART := y
 EARLY_PRINTK_BAUD := 115200
 EARLY_UART_BASE_ADDRESS := 0x12c20000
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), midway)
+EARLY_PRINTK_INC := pl011
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0xfff36000
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOt7-0003LA-TB; Fri, 31 May 2013 12:56:57 +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 1UiOt6-0003Kl-2D
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:56 +0000
Received: from [85.158.139.211:49909] by server-9.bemta-5.messagelabs.com id
	45/E3-14875-71E98A15; Fri, 31 May 2013 12:56:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1370005011!20384801!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20188 invoked from network); 31 May 2013 12:56:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 May 2013 12:56: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 1UiOt1-0004FG-7O
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOt1-00050o-5j
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:51 +0000
Date: Fri, 31 May 2013 12:56:51 +0000
Message-Id: <E1UiOt1-00050o-5j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: use Linux-compatible names for
	sse4 cpuid features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9fa437d084c521dabb5b6582fee3316e8cc6e2a3
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri May 24 15:33:27 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:24:14 2013 +0100

    libxl: use Linux-compatible names for sse4 cpuid features
    
    Linux uses sse4_1 and sse4_2, but at the moment libxl uses '.' instead
    of '_'.  This makes it confusing for people looking in Linux's /proc/cpuinfo
    to disable features.
    
    Add the Linux feature names, keeping the old ones for compatability.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.camppbell@citrix.com>
---
 docs/man/xl.cfg.pod.5     |    2 +-
 tools/libxl/libxl_cpuid.c |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e0c3bb2..4c92721 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -808,7 +808,7 @@ cmplegacy cmpxchg16 cmpxchg8 cntxid dca de ds dscpl dtes64 est extapic f16c
 ffxsr fma4 fpu fxsr htt hypervisor ia64 ibs lahfsahf lm lwp mca mce misalignsse
 mmx mmxext monitor movbe msr mtrr nodeid nx osvw osxsave pae page1gb pat pbe
 pclmulqdq pdcm pge popcnt pse pse36 psn rdtscp skinit smx ss sse sse2 sse3
-sse4.1 sse4.2 sse4a ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips
+sse4_1 sse4_2 sse4a ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips
 svm_pausefilt svm_tscrate svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc
 vme vmx wdt x2apic xop xsave xtpr
 
diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index d17fdd6..e1c406c 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -99,8 +99,11 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
         {"popcnt",       0x00000001, NA, CPUID_REG_ECX, 23,  1},
         {"movbe",        0x00000001, NA, CPUID_REG_ECX, 22,  1},
         {"x2apic",       0x00000001, NA, CPUID_REG_ECX, 21,  1},
+        /* Linux uses sse4_{1,2}.  Keep sse4.{1,2} for compatibility */
         {"sse4.2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
+        {"sse4_2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
         {"sse4.1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
+        {"sse4_1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"dca",          0x00000001, NA, CPUID_REG_ECX, 18,  1},
         {"pdcm",         0x00000001, NA, CPUID_REG_ECX, 15,  1},
         {"xtpr",         0x00000001, NA, CPUID_REG_ECX, 14,  1},
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:56:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:56: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 1UiOt7-0003LA-TB; Fri, 31 May 2013 12:56:57 +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 1UiOt6-0003Kl-2D
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:56 +0000
Received: from [85.158.139.211:49909] by server-9.bemta-5.messagelabs.com id
	45/E3-14875-71E98A15; Fri, 31 May 2013 12:56:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1370005011!20384801!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.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20188 invoked from network); 31 May 2013 12:56:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 May 2013 12:56: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 1UiOt1-0004FG-7O
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOt1-00050o-5j
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:51 +0000
Date: Fri, 31 May 2013 12:56:51 +0000
Message-Id: <E1UiOt1-00050o-5j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: use Linux-compatible names for
	sse4 cpuid features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 9fa437d084c521dabb5b6582fee3316e8cc6e2a3
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri May 24 15:33:27 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:24:14 2013 +0100

    libxl: use Linux-compatible names for sse4 cpuid features
    
    Linux uses sse4_1 and sse4_2, but at the moment libxl uses '.' instead
    of '_'.  This makes it confusing for people looking in Linux's /proc/cpuinfo
    to disable features.
    
    Add the Linux feature names, keeping the old ones for compatability.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.camppbell@citrix.com>
---
 docs/man/xl.cfg.pod.5     |    2 +-
 tools/libxl/libxl_cpuid.c |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e0c3bb2..4c92721 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -808,7 +808,7 @@ cmplegacy cmpxchg16 cmpxchg8 cntxid dca de ds dscpl dtes64 est extapic f16c
 ffxsr fma4 fpu fxsr htt hypervisor ia64 ibs lahfsahf lm lwp mca mce misalignsse
 mmx mmxext monitor movbe msr mtrr nodeid nx osvw osxsave pae page1gb pat pbe
 pclmulqdq pdcm pge popcnt pse pse36 psn rdtscp skinit smx ss sse sse2 sse3
-sse4.1 sse4.2 sse4a ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips
+sse4_1 sse4_2 sse4a ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips
 svm_pausefilt svm_tscrate svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc
 vme vmx wdt x2apic xop xsave xtpr
 
diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index d17fdd6..e1c406c 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -99,8 +99,11 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
         {"popcnt",       0x00000001, NA, CPUID_REG_ECX, 23,  1},
         {"movbe",        0x00000001, NA, CPUID_REG_ECX, 22,  1},
         {"x2apic",       0x00000001, NA, CPUID_REG_ECX, 21,  1},
+        /* Linux uses sse4_{1,2}.  Keep sse4.{1,2} for compatibility */
         {"sse4.2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
+        {"sse4_2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
         {"sse4.1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
+        {"sse4_1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"dca",          0x00000001, NA, CPUID_REG_ECX, 18,  1},
         {"pdcm",         0x00000001, NA, CPUID_REG_ECX, 15,  1},
         {"xtpr",         0x00000001, NA, CPUID_REG_ECX, 14,  1},
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOtQ-0003Oz-0U; Fri, 31 May 2013 12:57: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 1UiOtO-0003Oa-JU
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:14 +0000
Received: from [85.158.139.83:14906] by server-15.bemta-5.messagelabs.com id
	81/14-31797-92E98A15; Fri, 31 May 2013 12:57:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1370005031!16836965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18787 invoked from network); 31 May 2013 12:57:12 -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;
	31 May 2013 12:57: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 1UiOtL-0004Fv-MN
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtL-00051Z-LF
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:11 +0000
Date: Fri, 31 May 2013 12:57:11 +0000
Message-Id: <E1UiOtL-00051Z-LF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gcov: update documentation on coverage.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8789dfb557116822907f7e63efc0530e28fd1e2c
Author:     Frediano Ziglio <frediano.ziglio@citrix.com>
AuthorDate: Thu May 23 13:55:15 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:31:05 2013 +0100

    gcov: update documentation on coverage.
    
    Fix some spelling.
    Add documentation for new xencov_split utility.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/coverage.markdown |   66 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 58 insertions(+), 8 deletions(-)

diff --git a/docs/misc/coverage.markdown b/docs/misc/coverage.markdown
index 74af665..9a88c89 100644
--- a/docs/misc/coverage.markdown
+++ b/docs/misc/coverage.markdown
@@ -3,21 +3,22 @@
 Coverare support allow you to get coverage information from Xen execution.
 You can see how many times a line is executed.
 
-The compiler have specific options that enable the collection of these
-information. Every basic block in the code will be instructed by the compiler
-to compute these statistics. It should not be used in production as it slow
+Some compilers have specific options that enable the collection of this
+information. Every basic block in the code will be instrumented by the compiler
+to compute these statistics. It should not be used in production as it slows
 down your hypervisor.
 
 ## Enable coverage
 
-Test coverage support can be turned on compiling Xen with coverage option set
-to y.
+Test coverage support can be turned on compiling Xen with the `coverage` option set
+to `y`.
 
 Something like:
+
     cd xen
     make coverage=y
 
-(or change your `Config.mk` file).
+(or change your `.config` file).
 
 ## Extract coverage data
 
@@ -28,12 +29,61 @@ so the way you can use coverage from Xen is extract coverage data from Xen and
 then split these information into files.
 
 To extract data you use a simple utility called `xencov`. Mainly `xencore`
-allow you to do 3 operations:
+allows you to do 3 operations:
 
 * `xencov read` extract data
 * `xencov reset` reset all coverage counters
 * `xencov read-reset` extract data and reset counters at the same time.
 
-Another utility (**TODO**) is used to split extracted data file into files
+Another utility (`xencov_split`) is used to split extracted data file into files
 needed by userspace tools.
 
+## Split coverage data
+
+Once you extracted data from Xen, it is time to create files which the coverage tools
+can understand. To do it you need to run `xencov_split` utility.
+
+The utility just takes an input file and splits the blob into gcc .gcda files
+in the same directory that you execute the script. As file names are generated
+relative to the current directory, it could be a good idea to run the script
+from `/` on your build machine.
+
+Code for splitting the blob is put in another utility for some reason:
+* It is simpler to maintain a high level script than a C program;
+* You don't need to execute on the Xen host so you just need to copy the file to
+  your development box (you usually need development files anyway).
+
+## Possible use
+
+**This section is just an example on how to use these tools!**
+
+This example assumes you compiled Xen from `~/xen-unstable` and installed into
+the host. **Consider that if you even recompile Xen you are not able to use
+blob extracted from xencov!**
+
+* Ensure the `lcov` package is installed
+* From the Xen host machine extract the coverage blob
+
+        cd /root
+        xencov read coverage.dat
+
+* Copy the extracted blob to your dev machine
+
+        cd ~
+        scp root@myhost:coverage.dat
+
+* Extract the coverage information
+
+        (cd / && xencov_split ~/coverage.dat)
+
+* Produce coverage html output
+
+        cd ~/xen-unstable
+        rm -rf cov.info cov
+        geninfo -o cov.info xen
+        mkdir cov
+        genhtml -o cov cov.info
+
+* See output in a browser
+
+        firefox cov/index.html
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOtQ-0003Oz-0U; Fri, 31 May 2013 12:57: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 1UiOtO-0003Oa-JU
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:14 +0000
Received: from [85.158.139.83:14906] by server-15.bemta-5.messagelabs.com id
	81/14-31797-92E98A15; Fri, 31 May 2013 12:57:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1370005031!16836965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18787 invoked from network); 31 May 2013 12:57:12 -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;
	31 May 2013 12:57: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 1UiOtL-0004Fv-MN
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtL-00051Z-LF
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:11 +0000
Date: Fri, 31 May 2013 12:57:11 +0000
Message-Id: <E1UiOtL-00051Z-LF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gcov: update documentation on coverage.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8789dfb557116822907f7e63efc0530e28fd1e2c
Author:     Frediano Ziglio <frediano.ziglio@citrix.com>
AuthorDate: Thu May 23 13:55:15 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:31:05 2013 +0100

    gcov: update documentation on coverage.
    
    Fix some spelling.
    Add documentation for new xencov_split utility.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/coverage.markdown |   66 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 58 insertions(+), 8 deletions(-)

diff --git a/docs/misc/coverage.markdown b/docs/misc/coverage.markdown
index 74af665..9a88c89 100644
--- a/docs/misc/coverage.markdown
+++ b/docs/misc/coverage.markdown
@@ -3,21 +3,22 @@
 Coverare support allow you to get coverage information from Xen execution.
 You can see how many times a line is executed.
 
-The compiler have specific options that enable the collection of these
-information. Every basic block in the code will be instructed by the compiler
-to compute these statistics. It should not be used in production as it slow
+Some compilers have specific options that enable the collection of this
+information. Every basic block in the code will be instrumented by the compiler
+to compute these statistics. It should not be used in production as it slows
 down your hypervisor.
 
 ## Enable coverage
 
-Test coverage support can be turned on compiling Xen with coverage option set
-to y.
+Test coverage support can be turned on compiling Xen with the `coverage` option set
+to `y`.
 
 Something like:
+
     cd xen
     make coverage=y
 
-(or change your `Config.mk` file).
+(or change your `.config` file).
 
 ## Extract coverage data
 
@@ -28,12 +29,61 @@ so the way you can use coverage from Xen is extract coverage data from Xen and
 then split these information into files.
 
 To extract data you use a simple utility called `xencov`. Mainly `xencore`
-allow you to do 3 operations:
+allows you to do 3 operations:
 
 * `xencov read` extract data
 * `xencov reset` reset all coverage counters
 * `xencov read-reset` extract data and reset counters at the same time.
 
-Another utility (**TODO**) is used to split extracted data file into files
+Another utility (`xencov_split`) is used to split extracted data file into files
 needed by userspace tools.
 
+## Split coverage data
+
+Once you extracted data from Xen, it is time to create files which the coverage tools
+can understand. To do it you need to run `xencov_split` utility.
+
+The utility just takes an input file and splits the blob into gcc .gcda files
+in the same directory that you execute the script. As file names are generated
+relative to the current directory, it could be a good idea to run the script
+from `/` on your build machine.
+
+Code for splitting the blob is put in another utility for some reason:
+* It is simpler to maintain a high level script than a C program;
+* You don't need to execute on the Xen host so you just need to copy the file to
+  your development box (you usually need development files anyway).
+
+## Possible use
+
+**This section is just an example on how to use these tools!**
+
+This example assumes you compiled Xen from `~/xen-unstable` and installed into
+the host. **Consider that if you even recompile Xen you are not able to use
+blob extracted from xencov!**
+
+* Ensure the `lcov` package is installed
+* From the Xen host machine extract the coverage blob
+
+        cd /root
+        xencov read coverage.dat
+
+* Copy the extracted blob to your dev machine
+
+        cd ~
+        scp root@myhost:coverage.dat
+
+* Extract the coverage information
+
+        (cd / && xencov_split ~/coverage.dat)
+
+* Produce coverage html output
+
+        cd ~/xen-unstable
+        rm -rf cov.info cov
+        geninfo -o cov.info xen
+        mkdir cov
+        genhtml -o cov cov.info
+
+* See output in a browser
+
+        firefox cov/index.html
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOta-0003Rn-3O; Fri, 31 May 2013 12:57:26 +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 1UiOtY-0003RB-HD
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:24 +0000
Received: from [85.158.139.83:12247] by server-2.bemta-5.messagelabs.com id
	A8/D7-26552-33E98A15; Fri, 31 May 2013 12:57:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1370005042!20640227!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20635 invoked from network); 31 May 2013 12:57:23 -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;
	31 May 2013 12:57: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 1UiOtV-0004Fy-RK
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtV-00051v-QB
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:21 +0000
Date: Fri, 31 May 2013 12:57:21 +0000
Message-Id: <E1UiOtV-00051v-QB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Update example xl.conf with
	correct name for default script 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 ffa27970bc995ac8724f5e0d0bd0180bef5a340a
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Wed May 29 12:53:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:34:11 2013 +0100

    xl: Update example xl.conf with correct name for default script option
    
    We've changed the config option from "vifscript" to "vif.default.script".  This
    was changed in the manpage but not in the example xl.conf.
    
    Also move the option down to be with the other vif options.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/examples/xl.conf |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index 9402c3f..9c037a6 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -8,9 +8,6 @@
 # full path of the lockfile used by xl during domain creation
 #lockfile="/var/lock/xl"
 
-# default vif script 
-#vifscript="vif-bridge"
-
 # default output format used by "xl list -l"
 #output_format="json"
 
@@ -25,6 +22,9 @@
 # default gateway device to use with vif-route hotplug script
 #vif.default.gatewaydev="eth0"
 
+# default vif script to use if none is specified in the guest config
+#vif.default.script="vif-bridge"
+
 # default bridge device to use with vif-bridge hotplug scripts
 #vif.default.bridge="xenbr0"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOta-0003Rn-3O; Fri, 31 May 2013 12:57:26 +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 1UiOtY-0003RB-HD
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:24 +0000
Received: from [85.158.139.83:12247] by server-2.bemta-5.messagelabs.com id
	A8/D7-26552-33E98A15; Fri, 31 May 2013 12:57:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1370005042!20640227!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20635 invoked from network); 31 May 2013 12:57:23 -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;
	31 May 2013 12:57: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 1UiOtV-0004Fy-RK
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtV-00051v-QB
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:21 +0000
Date: Fri, 31 May 2013 12:57:21 +0000
Message-Id: <E1UiOtV-00051v-QB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Update example xl.conf with
	correct name for default script 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 ffa27970bc995ac8724f5e0d0bd0180bef5a340a
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Wed May 29 12:53:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:34:11 2013 +0100

    xl: Update example xl.conf with correct name for default script option
    
    We've changed the config option from "vifscript" to "vif.default.script".  This
    was changed in the manpage but not in the example xl.conf.
    
    Also move the option down to be with the other vif options.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/examples/xl.conf |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index 9402c3f..9c037a6 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -8,9 +8,6 @@
 # full path of the lockfile used by xl during domain creation
 #lockfile="/var/lock/xl"
 
-# default vif script 
-#vifscript="vif-bridge"
-
 # default output format used by "xl list -l"
 #output_format="json"
 
@@ -25,6 +22,9 @@
 # default gateway device to use with vif-route hotplug script
 #vif.default.gatewaydev="eth0"
 
+# default vif script to use if none is specified in the guest config
+#vif.default.script="vif-bridge"
+
 # default bridge device to use with vif-bridge hotplug scripts
 #vif.default.bridge="xenbr0"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOtk-0003Ub-85; Fri, 31 May 2013 12:57:36 +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 1UiOti-0003Tv-Di
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:34 +0000
Received: from [85.158.143.99:43589] by server-1.bemta-4.messagelabs.com id
	40/9D-06122-D3E98A15; Fri, 31 May 2013 12:57:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1370005052!20887364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1384 invoked from network); 31 May 2013 12:57:33 -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;
	31 May 2013 12:57: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 1UiOtg-0004G6-0x
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtf-00052o-VR
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:31 +0000
Date: Fri, 31 May 2013 12:57:31 +0000
Message-Id: <E1UiOtf-00052o-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix qemu-xen command line for
	vcpus 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

commit 9da60855040d480d7269ac7717e27bd9e8106bf0
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed May 29 19:11:15 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:34:56 2013 +0100

    libxl: Fix qemu-xen command line for vcpus numbers.
    
    On the qemu-xen command line, the number of vcpus initially online and
    the number of maximum available vcpus are inverted.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d10a58f..1e3a9f4 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -533,8 +533,8 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                 nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
                 flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d",
-                                                         b_info->max_vcpus,
-                                                         nr_set_cpus));
+                                                         nr_set_cpus,
+                                                         b_info->max_vcpus));
             } else
                 flexarray_append(dm_args, libxl__sprintf(gc, "%d",
                                                          b_info->max_vcpus));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOtk-0003Ub-85; Fri, 31 May 2013 12:57:36 +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 1UiOti-0003Tv-Di
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:34 +0000
Received: from [85.158.143.99:43589] by server-1.bemta-4.messagelabs.com id
	40/9D-06122-D3E98A15; Fri, 31 May 2013 12:57:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1370005052!20887364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1384 invoked from network); 31 May 2013 12:57:33 -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;
	31 May 2013 12:57: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 1UiOtg-0004G6-0x
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtf-00052o-VR
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:31 +0000
Date: Fri, 31 May 2013 12:57:31 +0000
Message-Id: <E1UiOtf-00052o-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix qemu-xen command line for
	vcpus 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

commit 9da60855040d480d7269ac7717e27bd9e8106bf0
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed May 29 19:11:15 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:34:56 2013 +0100

    libxl: Fix qemu-xen command line for vcpus numbers.
    
    On the qemu-xen command line, the number of vcpus initially online and
    the number of maximum available vcpus are inverted.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d10a58f..1e3a9f4 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -533,8 +533,8 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                 nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
                 flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d",
-                                                         b_info->max_vcpus,
-                                                         nr_set_cpus));
+                                                         nr_set_cpus,
+                                                         b_info->max_vcpus));
             } else
                 flexarray_append(dm_args, libxl__sprintf(gc, "%d",
                                                          b_info->max_vcpus));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOtv-0003Xo-Jx; Fri, 31 May 2013 12:57:47 +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 1UiOtt-0003XD-Bh
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:45 +0000
Received: from [85.158.138.51:9355] by server-4.bemta-3.messagelabs.com id
	79/BC-01776-84E98A15; Fri, 31 May 2013 12:57:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1370005062!28058529!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12898 invoked from network); 31 May 2013 12:57:43 -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;
	31 May 2013 12:57: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 1UiOtq-0004GF-9q
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtq-00053D-7z
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:42 +0000
Date: Fri, 31 May 2013 12:57:42 +0000
Message-Id: <E1UiOtq-00053D-7z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Remove qxl support for the 4.3
	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 5479961ab55e118b8c80db7724721e78743363c7
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri May 24 16:20:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:35:34 2013 +0100

    libxl: Remove qxl support for the 4.3 release
    
    The qxl drivers for Windows and Linux end up calling instructions
    that cannot be used for MMIO at the moment.  Just for the 4.3 release,
    remove qxl support.
    
    This patch should be reverted as soon as the 4.4 development window opens.
    
    The issue in question:
    
    (XEN) emulate.c:88:d18 bad mmio size 16
    (XEN) io.c:201:d18 MMIO emulation failed @ 0033:7fd2de390430: f3 0f 6f
    19 41 83 e8 403
    
    The instruction in question is "movdqu (%rcx),%xmm3".  Xen knows how
    to emulate it, but unfortunately %xmm3 is 16 bytes long, and the interface
    between Xen and qemu at the moment would appear to only allow MMIO accesses
    of 8 bytes.
    
    It's too late in the release cycle to find a fix or a workaround.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5       |   10 +---------
 tools/libxl/libxl_create.c  |   16 ----------------
 tools/libxl/libxl_dm.c      |   13 -------------
 tools/libxl/libxl_types.idl |    1 -
 tools/libxl/xl_cmdimpl.c    |    2 --
 5 files changed, 1 insertions(+), 41 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 4c92721..b7d64a6 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1005,9 +1005,6 @@ the amount of video ram is fixed at 4MB which is sufficient
 for 1024x768 at 32 bpp and videoram option is currently working
 only when using the upstream qemu-xen device-model.
 
-For B<qxl> vga, the default is both default and minimal 128MB.
-If B<videoram> is set less than 128MB, an error will be triggered.
-
 =item B<stdvga=BOOLEAN>
 
 Select a standard VGA card with VBE (VESA BIOS Extensions) as the
@@ -1019,14 +1016,9 @@ This option is deprecated, use vga="stdvga" instead.
 
 =item B<vga="STRING">
 
-Selects the emulated video card (stdvga|cirrus|qxl).
+Selects the emulated video card (stdvga|cirrus).
 The default is cirrus.
 
-In general, QXL should work with the Spice remote display protocol
-for acceleration, and QXL driver is necessary in guest in this case.
-QXL can also work with the VNC protocol, but it will be like a standard
-VGA without acceleration.
-
 =item B<vnc=BOOLEAN>
 
 Allow access to the display via the VNC protocol.  This enables the
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index cb9c822..0c32d0b 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -213,22 +213,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
 
-        if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_QXL) {
-            if (b_info->device_model_version ==
-               LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
-                if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) {
-                    b_info->video_memkb = (128 * 1024);
-                } else if (b_info->video_memkb < (128 * 1024)) {
-                    LOG(ERROR,
-                        "128 Mib videoram is the minimum for qxl default");
-                    return ERROR_INVAL;
-                }
-            } else {
-                LOG(ERROR,"qemu upstream required for qxl vga");
-                return ERROR_INVAL;
-            }
-        }
-
         if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_STD &&
             b_info->device_model_version ==
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 1e3a9f4..ac1f90e 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -191,8 +191,6 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
             break;
         case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
             break;
-        case LIBXL_VGA_INTERFACE_TYPE_QXL:
-            break;
         }
 
         if (b_info->u.hvm.boot) {
@@ -479,17 +477,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                     libxl__sizekb_to_mb(b_info->video_memkb)), NULL);
             }
             break;
-        case LIBXL_VGA_INTERFACE_TYPE_QXL:
-            /* QXL have 2 ram regions, ram and vram */
-            flexarray_vappend(dm_args, "-vga", "qxl", NULL);
-            if (b_info->video_memkb) {
-                flexarray_vappend(dm_args, "-global",
-                    GCSPRINTF("qxl-vga.vram_size_mb=%"PRIu64,
-                    (b_info->video_memkb/2/1024)), "-global",
-                    GCSPRINTF("qxl-vga.ram_size_mb=%"PRIu64,
-                    (b_info->video_memkb/2/1024)), NULL);
-            }
-            break;
         }
 
         if (b_info->u.hvm.boot) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 8262cba..d218a2d 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -130,7 +130,6 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),
     (2, "STD"),
-    (3, "QXL"),
     ], init_val = 0)
 
 #
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c5292f4..8a478ba 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1456,8 +1456,6 @@ skip_vfb:
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_STD;
             } else if (!strcmp(buf, "cirrus")) {
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
-            } else if (!strcmp(buf, "qxl")) {
-                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_QXL;
             } else {
                 fprintf(stderr, "Unknown vga \"%s\" specified\n", buf);
                 exit(1);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOtv-0003Xo-Jx; Fri, 31 May 2013 12:57:47 +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 1UiOtt-0003XD-Bh
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:45 +0000
Received: from [85.158.138.51:9355] by server-4.bemta-3.messagelabs.com id
	79/BC-01776-84E98A15; Fri, 31 May 2013 12:57:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1370005062!28058529!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12898 invoked from network); 31 May 2013 12:57:43 -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;
	31 May 2013 12:57: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 1UiOtq-0004GF-9q
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtq-00053D-7z
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:42 +0000
Date: Fri, 31 May 2013 12:57:42 +0000
Message-Id: <E1UiOtq-00053D-7z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Remove qxl support for the 4.3
	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 5479961ab55e118b8c80db7724721e78743363c7
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Fri May 24 16:20:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:35:34 2013 +0100

    libxl: Remove qxl support for the 4.3 release
    
    The qxl drivers for Windows and Linux end up calling instructions
    that cannot be used for MMIO at the moment.  Just for the 4.3 release,
    remove qxl support.
    
    This patch should be reverted as soon as the 4.4 development window opens.
    
    The issue in question:
    
    (XEN) emulate.c:88:d18 bad mmio size 16
    (XEN) io.c:201:d18 MMIO emulation failed @ 0033:7fd2de390430: f3 0f 6f
    19 41 83 e8 403
    
    The instruction in question is "movdqu (%rcx),%xmm3".  Xen knows how
    to emulate it, but unfortunately %xmm3 is 16 bytes long, and the interface
    between Xen and qemu at the moment would appear to only allow MMIO accesses
    of 8 bytes.
    
    It's too late in the release cycle to find a fix or a workaround.
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5       |   10 +---------
 tools/libxl/libxl_create.c  |   16 ----------------
 tools/libxl/libxl_dm.c      |   13 -------------
 tools/libxl/libxl_types.idl |    1 -
 tools/libxl/xl_cmdimpl.c    |    2 --
 5 files changed, 1 insertions(+), 41 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 4c92721..b7d64a6 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1005,9 +1005,6 @@ the amount of video ram is fixed at 4MB which is sufficient
 for 1024x768 at 32 bpp and videoram option is currently working
 only when using the upstream qemu-xen device-model.
 
-For B<qxl> vga, the default is both default and minimal 128MB.
-If B<videoram> is set less than 128MB, an error will be triggered.
-
 =item B<stdvga=BOOLEAN>
 
 Select a standard VGA card with VBE (VESA BIOS Extensions) as the
@@ -1019,14 +1016,9 @@ This option is deprecated, use vga="stdvga" instead.
 
 =item B<vga="STRING">
 
-Selects the emulated video card (stdvga|cirrus|qxl).
+Selects the emulated video card (stdvga|cirrus).
 The default is cirrus.
 
-In general, QXL should work with the Spice remote display protocol
-for acceleration, and QXL driver is necessary in guest in this case.
-QXL can also work with the VNC protocol, but it will be like a standard
-VGA without acceleration.
-
 =item B<vnc=BOOLEAN>
 
 Allow access to the display via the VNC protocol.  This enables the
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index cb9c822..0c32d0b 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -213,22 +213,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
 
-        if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_QXL) {
-            if (b_info->device_model_version ==
-               LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
-                if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) {
-                    b_info->video_memkb = (128 * 1024);
-                } else if (b_info->video_memkb < (128 * 1024)) {
-                    LOG(ERROR,
-                        "128 Mib videoram is the minimum for qxl default");
-                    return ERROR_INVAL;
-                }
-            } else {
-                LOG(ERROR,"qemu upstream required for qxl vga");
-                return ERROR_INVAL;
-            }
-        }
-
         if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_STD &&
             b_info->device_model_version ==
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 1e3a9f4..ac1f90e 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -191,8 +191,6 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
             break;
         case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
             break;
-        case LIBXL_VGA_INTERFACE_TYPE_QXL:
-            break;
         }
 
         if (b_info->u.hvm.boot) {
@@ -479,17 +477,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                     libxl__sizekb_to_mb(b_info->video_memkb)), NULL);
             }
             break;
-        case LIBXL_VGA_INTERFACE_TYPE_QXL:
-            /* QXL have 2 ram regions, ram and vram */
-            flexarray_vappend(dm_args, "-vga", "qxl", NULL);
-            if (b_info->video_memkb) {
-                flexarray_vappend(dm_args, "-global",
-                    GCSPRINTF("qxl-vga.vram_size_mb=%"PRIu64,
-                    (b_info->video_memkb/2/1024)), "-global",
-                    GCSPRINTF("qxl-vga.ram_size_mb=%"PRIu64,
-                    (b_info->video_memkb/2/1024)), NULL);
-            }
-            break;
         }
 
         if (b_info->u.hvm.boot) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 8262cba..d218a2d 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -130,7 +130,6 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),
     (2, "STD"),
-    (3, "QXL"),
     ], init_val = 0)
 
 #
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c5292f4..8a478ba 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1456,8 +1456,6 @@ skip_vfb:
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_STD;
             } else if (!strcmp(buf, "cirrus")) {
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
-            } else if (!strcmp(buf, "qxl")) {
-                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_QXL;
             } else {
                 fprintf(stderr, "Unknown vga \"%s\" specified\n", buf);
                 exit(1);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOu5-0003bb-SE; Fri, 31 May 2013 12:57:57 +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 1UiOu4-0003aG-Bd
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:56 +0000
Received: from [85.158.139.83:16308] by server-7.bemta-5.messagelabs.com id
	92/AD-12828-35E98A15; Fri, 31 May 2013 12:57:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1370005072!29967043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20217 invoked from network); 31 May 2013 12:57:53 -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;
	31 May 2013 12:57: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 1UiOu0-0004GO-FP
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOu0-00053v-D8
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:52 +0000
Date: Fri, 31 May 2013 12:57:52 +0000
Message-Id: <E1UiOu0-00053v-D8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenballoond: remove as it is now
	obsolete + unsupported 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

commit 1adef1732f67b4039170210bb2e67c64c9dabd4c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Apr 22 13:14:16 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 10:02:04 2013 +0100

    xenballoond: remove as it is now obsolete + unsupported code
    
    Dan, the author, states:
    > this code is five years old, is distro dependent, and is now
    > completely unsupported.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/xenballoon/xenballoon-monitor |   59 -------
 tools/xenballoon/xenballoon.conf    |  136 -----------------
 tools/xenballoon/xenballoond        |  283 -----------------------------------
 tools/xenballoon/xenballoond.README |   85 -----------
 tools/xenballoon/xenballoond.init   |   92 -----------
 5 files changed, 0 insertions(+), 655 deletions(-)

diff --git a/tools/xenballoon/xenballoon-monitor b/tools/xenballoon/xenballoon-monitor
deleted file mode 100644
index c23cd39..0000000
--- a/tools/xenballoon/xenballoon-monitor
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-#
-# xenballoon-monitor - monitor certain stats from xenballoond
-#   (run in dom0 with "watch -d xenballoon-monitor" for xentop-like output)
-# updated 090610 to include tmem stats
-#
-# Copyright (C) 2009 Oracle Corporation and/or its affiliates.
-# All rights reserved
-# Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
-#
-# Hint: Use "xm sched-credit -d 0 -w 2000" to watch on heavily loaded machines
-#
-TMEMTMP=$(/bin/mktemp -q /tmp/xenballoon-monitor.XXXXXX)
-echo "id   mem-kb  tgt-kb  commit  swapin swapout    pgin    pgout  preswap  precache"
-for i in `xenstore-list /local/domain`; do
- if [ "$i" -ne 0 ]; then
- tot=0; tgt=0; sin=0; sout=0; pgin=0; pgout=0; cmt=0; up=0; idle=0;
- act=0; preswap=0; precache=0
- if xenstore-exists /local/domain/$i/memory/meminfo; then
-  tot=`xenstore-read /local/domain/$i/memory/meminfo | grep MemTotal \
-   | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'`
-  cmt=`xenstore-read /local/domain/$i/memory/meminfo | grep Committed_AS \
-   | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'`
- fi
- if xenstore-exists /local/domain/$i/memory/selftarget; then
-  tgt=`xenstore-read /local/domain/$i/memory/selftarget`
- fi
- if xenstore-exists /local/domain/$i/memory/vmstat; then
-  sin=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pswpin | cut -d" " -f2)
-  sout=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pswpout | cut -d" " -f2)
-  pgin=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pgpgin | cut -d" " -f2)
-  pgout=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pgout | cut -d" " -f2)
- fi
- xm tmem-list --all --long > $TMEMTMP
- precache=`grep "C=CI:$i" $TMEMTMP | sed 's/C=CI.*Ec:\([0-9][0-9]*\).*/\1/'`
- if xenstore-exists /local/domain/$i/memory/preswap; then
-  preswap=`xenstore-read /local/domain/$i/memory/preswap`
-  printf "%2d %8d%8d%8d%7d%8d%9d%9d%9d%9d\n" $i $tot $tgt $cmt $sin $sout $pgin $pgout $preswap $precache
- else
-  printf "%2d %8d%8d%8d%9d%9d%10d%10d\n" $i $tot $tgt $cmt $sin $sout $pgin $pgout
- fi
- fi
-done
-echo -n Free memory: `xm info | grep free | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'` MiB "  "
-tmem_free_pages=`grep "G=" $TMEMTMP | sed 's/G=.*Ta:\([0-9][0-9]*\).*/\1/'`
-if [ ! -z "$tmem_free_pages" ]; then
- let "tmem_free_mb=$tmem_free_pages/256"
- echo -n Idle tmem: $tmem_free_mb MiB "  "
-fi
-tmem_eph_pages=`grep "G=" $TMEMTMP | sed 's/G=.*Ec:\([0-9][0-9]*\).*/\1/'`
-if [ ! -z "$tmem_eph_pages" ]; then
- let "tmem_eph_mb=$tmem_eph_pages/256"
- echo -n Ephemeral tmem: $tmem_eph_mb MiB
-fi
-echo ""
diff --git a/tools/xenballoon/xenballoon.conf b/tools/xenballoon/xenballoon.conf
deleted file mode 100644
index a1ca902..0000000
--- a/tools/xenballoon/xenballoon.conf
+++ /dev/null
@@ -1,136 +0,0 @@
-## Path: System/xen
-## Description: xen domain start/stop on boot
-## Type: string
-## Default: 
-
-# NOTE: "xenbus is enabled" means not only that /proc/xen/xenbus exists
-# but also that /usr/bin/xenstore-* tools are installed.
-
-## Type: boolean
-## Default: false
-#
-# If XENBALLOON_SELF is true, selfballooning will occur, meaning the
-# balloon driver will grow and shrink according to available memory.
-# If xenbus is enabled, may be overridden by {memory/selfballoon}==0
-# If false but xenballoond is able to communicate with domain0 via
-# xenbus, balloon targets will be set by domain0
-# 
-XENBALLOON_SELF=false
-
-## Type: integer (must be > 0)
-## Default: 1
-#
-# If self-ballooning, number of seconds between checks/adjustments.
-# If xenbus is enabled, may be overridden by {memory/interval}
-XENBALLOON_SELF_INTERVAL=1
-
-## Type: integer (must be > 0)
-## Default: 1
-#
-# If NOT self-ballooning but xenbus is enabled, number of seconds between
-# checks/adjustments. May be overridden by {memory/interval}
-XENBALLOON_INTERVAL=1
-
-## Type: integer (must be > 0)
-## Default: 10
-#
-# When current > target, reduces rate at which target memory is ballooned
-# out.  For a value of n, 1/n of the difference will be ballooned.
-# This value applies both to selfballooning and directed ballooning.
-# May be overridden by {memory/downhysteresis}
-XENBALLOON_AUTO_DOWNHYSTERESIS=10
-
-## Type: integer (must be > 0)
-## Default: 1
-#
-# When current < target, reduces rate at which target memory is reclaimed
-# (if available).  For a value of n, 1/n of the difference will be ballooned.
-# This value applies both to selfballooning and directed ballooning.
-# May be overridden by {memory/uphysteresis}
-XENBALLOON_AUTO_UPHYSTERESIS=1
-
-## Type: integer (must be >= 0)
-## Default: 0
-#
-# In order to avoid ballooning so much memory that a guest experiences
-# out-of-memory errors (OOMs), memory will not be ballooned out below
-# a minimum target, in MB.  If this value is 0 (default), an heuristic
-# based on the maximum amount of memory will be used.  (The heuristic
-# provides the same minimum as recent versions of the balloon driver but
-# early versions of the balloon driver did not enforce a minimum.)
-XENBALLOON_MINMEM=0
-
-## Type: string
-## Default: "/var/run/xenballoon-maxmem"
-#
-# Location where memory high-water mark is stored; if a guest supports
-# hot-add memory, maxmem might increase across time and the minimum
-# target heuristic is based on max memory. NOTE: Reboot after changing
-# this variable, else overballooning may occur.
-XENBALLOON_MAXMEMFILE=/var/run/xenballoon-maxmem
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the result of 'cat /proc/meminfo" on xenbus at memory/meminfo
-XENBALLOON_SEND_MEMINFO=1
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the result of 'cat /proc/vmstat" on xenbus at memory/vmstat
-XENBALLOON_SEND_VMSTAT=1
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the result of 'cat /proc/uptime" on xenbus at memory/uptime
-XENBALLOON_SEND_UPTIME=1
-
-## Type: boolean
-## Default: false
-#
-# If tmem is running, pages swapped to a swap disk may instead go
-# into preswap.  These pages may become stale (i.e. no longer need
-# to be saved because, e.g., the process owning them has gone away)
-# and stale pages use precious precious domain-allocated memory.
-# Periodically try to reduce preswap to squeeze out stale pages
-XENBALLOON_PRESWAP_SHRINK=false
-
-## Type: string
-## Default: "/proc/sys/vm/preswap"
-## (change to /sys/proc/vm/preswap in later kernels)
-#
-# If tmem and preswap are running, reading this file gives the number of
-# pages currently in preswap.  Writing it with N invokes the preswap_shrink
-# routine to reduce preswap to N pages.
-XENBALLOON_PRESWAP_SYSFILE=/proc/sys/vm/preswap
-
-## Type: integer (must be > 0)
-## Default: 20
-#
-# If tmem and preswap are running, attempts to reduce number of pages
-# currently in preswap.  For a value of n, 1/n of the pages will
-# be attempted to be shrunk.
-# If xenbus is enabled, may be overridden by {memory/preswaphysteresis}
-XENBALLOON_PRESWAP_HYSTERESIS=20
-
-## Type: integer (must be > 0)
-## Default: 10
-#
-# Number of ballooning intervals where preswap size remains at N pages
-# before preswap shrinking is attempted.  Also if shrinking fails to
-# shrink to the target, counter resets to this value.
-# If xenbus is enabled, may be overridden by {memory/preswapinertia}
-XENBALLOON_PRESWAP_INERTIA=10
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the size of preswap (in pages) on xenbus at memory/preswap
-XENBALLOON_SEND_PRESWAP=1
-
diff --git a/tools/xenballoon/xenballoond b/tools/xenballoon/xenballoond
deleted file mode 100644
index 121aa3e..0000000
--- a/tools/xenballoon/xenballoond
+++ /dev/null
@@ -1,283 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2008 Oracle Corporation and/or its affiliates.
-# All rights reserved.
-# Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
-#
-# xenballoond - In-guest engine for Xen memory ballooning
-# Original version: 080630
-# Updated 0906XX: add tmem preswap auto-shrinking
-#
-# Two self-ballooning "policies" are implemented:
-# - Selfballooning: Adjust memory periodically, with no (or little) input
-#     from domain0.  Target memory is determined solely by the
-#     Committed_AS line in /proc/meminfo, but parameters may adjust
-#     the rate at which the target is achieved.
-# - Directed ballooning: Adjust memory solely as directed by domain0
-#
-# Under some circumstances, "output" may also be generated; the contents
-# of /proc/meminfo and /proc/vmstat may be periodically placed on xenbus.
-#
-# If xenbus is running and the /usr/bin/xenstore-* tools are installed,
-# "xenbus is enabled".
-#
-# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although
-# some are not used with directed ballooning, all must be set properly.
-# If xenbus is enabled, some of these parameters may be overridden by values
-# set by domain0 via xenbus.
-
-minmb() {
-	RETVAL=$XENBALLOON_MINMEM
-	if [ $RETVAL -ne 0 ]; then
-		return $RETVAL
-	fi
-	kb=`cat $XENBALLOON_MAXMEMFILE`
-	let "mb=$kb/1024"
-	let "pages=$kb/4"
-	# this algorithm from drivers/xen/balloon/balloon.c:minimum_target()
-	# which was added to balloon.c in 2008 to avoid ballooning too small
-	# it is unnecessary here except to accomodate pre-2008 balloon drivers
-	# note that ranges are adjusted because a VM with "memory=1024"
-	# gets somewhat less than 1024MB
-	if [ $mb -lt 125 ]; then
-		let RETVAL="$(( 8 + ($pages >> 9) ))"
-	elif [ $mb -lt 500 ]; then
-		let RETVAL="$(( 40 + ($pages >> 10) ))"
-	elif [ $mb -lt 2000 ]; then
-		let RETVAL="$(( 104 + ($pages >> 11) ))"
-	else
-		let RETVAL="$(( 296 + ($pages >> 13) ))"
-	fi
-	return	# value returned in RETVAL in mB
-}
-
-curkb() {
-	kb=`grep MemTotal /proc/meminfo | sed 's/  */ /' | \
-		cut -f2 -d' '`
-	RETVAL=$kb
-	return  # value returned in RETVAL in kB
-}
-
-downhysteresis() {
-	RETVAL=$XENBALLOON_AUTO_DOWNHYSTERESIS
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/downhysteresis ; then
-			RETVAL=`xenstore-read memory/downhysteresis`
-		fi
-	fi
-	return
-}
-
-uphysteresis() {
-	RETVAL=$XENBALLOON_AUTO_UPHYSTERESIS
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/uphysteresis ; then
-			RETVAL=`xenstore-read memory/uphysteresis`
-		fi
-	fi
-	return
-}
-
-selfballoon_eval() {
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/selfballoon; then
-			RETVAL=`xenstore-read memory/selfballoon`
-			if [ $RETVAL -eq 1 ]; then
-				selfballoon_enabled=true
-				return
-			fi
-		fi
-	fi
-	selfballoon_enabled=$XENBALLOON_SELF
-	return
-}
-
-selftarget() {
-	tgtkb=`grep Committed_AS /proc/meminfo | sed 's/  */ /' | cut -f2 -d' '`
-	minmb
-	let "minbytes=$RETVAL*1024*1024"
-	let "tgtbytes=$tgtkb*1024"
-	if [ $tgtbytes -lt $minbytes ]; then
-		let "tgtbytes=$minbytes"
-	fi
-	RETVAL=$tgtbytes  # value returned in RETVAL in bytes
-	return
-}
-
-# $1 == 1 means use selftarget, else target in kB
-balloon_to_target() {
-	if [ "$1" -eq 1 ]; then
-		selftarget
-		tgtbytes=$RETVAL
-	else
-		let "tgtbytes=$(( $1 * 1024 ))"
-	fi
-	curkb
-	let "curbytes=$RETVAL*1024"
-	if [ $curbytes -gt $tgtbytes ]; then
-		downhysteresis
-		downhys=$RETVAL
-		if [ $downhys -ne 0 ]; then
-			let "tgtbytes=$(( $curbytes - \
-				( ( $curbytes - $tgtbytes ) / $downhys ) ))"
-		fi
-	else if [ $curbytes -lt $tgtbytes ]; then
-		uphysteresis
-		uphys=$RETVAL
-		let "tgtbytes=$(( $curbytes + \
-				( ( $tgtbytes - $curbytes ) / $uphys ) ))"
-		fi
-	fi
-	echo $tgtbytes > /proc/xen/balloon
-	if [ $xenstore_enabled = "true" ]; then
-		let "tgtkb=$(( $tgtbytes/1024 ))"
-		xenstore-write memory/selftarget $tgtkb
-	fi
-}
-
-send_memory_stats() {
-	if [ ! $xenstore_enabled = "true" ]; then
-		return
-	fi
-	if [ $XENBALLOON_SEND_MEMINFO ]; then
-		xenstore-write memory/meminfo "`cat /proc/meminfo`"
-	fi
-	if [ $XENBALLOON_SEND_VMSTAT ]; then
-		xenstore-write memory/vmstat "`cat /proc/vmstat`"
-	fi
-	if [ $XENBALLOON_SEND_UPTIME ]; then
-		xenstore-write memory/uptime "`cat /proc/uptime`"
-	fi
-}
-
-
-curpreswappages() {
-	pages=$(cat $XENBALLOON_PRESWAP_SYSFILE)
-	RETVAL=$pages
-	return  # value returned in RETVAL in pages
-}
-
-preswaphysteresis() {
-	RETVAL=$XENBALLOON_PRESWAP_HYSTERESIS
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/preswaphysteresis ; then
-			RETVAL=`xenstore-read memory/preswaphysteresis`
-		fi
-	fi
-	return
-}
-
-preswapinertia() {
-	RETVAL=$XENBALLOON_PRESWAP_INERTIA
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/preswapinertia ; then
-			RETVAL=`xenstore-read memory/preswapinertia`
-		fi
-	fi
-	return
-}
-
-send_preswap_stats() {
-	if [ ! $xenstore_enabled = "true" ]; then
-		return
-	fi
-	curpreswappages
-	preswap_pgs=$RETVAL
-	if [ $XENBALLOON_SEND_PRESWAP ]; then
-		xenstore-write memory/preswap "$preswap_pgs"
-	fi
-}
-
-shrink_preswap() {
-	if [ "$XENBALLOON_PRESWAP_SHRINK" = "false" ]; then
-		return
-	fi
-	if [ ! -f "$XENBALLOON_PRESWAP_SYSFILE" ]; then
-		return
-	fi
-	curpreswappages
-	preswaplast=$preswapnow
-	preswapnow=$RETVAL
-	if [ $preswapnow -eq 0 -o $preswapnow -ne $preswaplast ]; then
-		preswapinertia
-		preswapinertiacounter=$RETVAL
-		return
-	fi
-	let "preswapinertiacounter=$preswapinertiacounter-1"
-	if [ $preswapinertiacounter -ne 0 ]; then
-		return
-	fi
-	preswaphysteresis
-	preswaphys=$RETVAL
-	if [ $preswaphys -eq 0 ]; then
-		return
-	fi
-	let "tgtpreswappages=$(( $preswapnow - \
-				( $preswapnow / $preswaphys ) ))"
-	preswapinertia
-	preswapinertiacounter=$RETVAL
-	echo $tgtpreswappages > "$XENBALLOON_PRESWAP_SYSFILE"
-}
-
-if [ ! -f /proc/xen/balloon ]; then
-	echo "$0: no balloon driver installed"
-	exit 0
-fi
-if [ ! -f /proc/meminfo ]; then
-	echo "$0: can't read /proc/meminfo"
-	exit 0
-fi
-xenstore_enabled=true
-if [ -f /usr/bin/xenstore-exists -a -f /usr/bin/xenstore-read -a \
-     -f /usr/bin/xenstore-write ]; then
-	xenstore_enabled=true
-else
-	echo "$0: missing /usr/bin/xenstore-* tools, disabling directed ballooning"
-	xenstore_enabled=false
-fi
-preswapnow=0
-
-# See docs/misc/distro_mapping.txt
-if [ -f /etc/sysconfig/xenballoon.conf ]; then
-	. /etc/sysconfig/xenballoon.conf
-elif [ -f /etc/default/xenballoon.conf ]; then
-	. /etc/default/xenballoon.conf
-fi
-
-while true;
-do
-	# handle special case for PV domains with hot-add memory
-	if [ ! -f $XENBALLOON_MAXMEMFILE ]; then
-		maxkb=0
-	else
-		maxkb=`cat $XENBALLOON_MAXMEMFILE`
-	fi
-	curkb=`grep MemTotal /proc/meminfo | sed 's/  */ /' | cut -f2 -d' '`
-	if [ $curkb -gt $maxkb ]; then
-		echo $curkb > $XENBALLOON_MAXMEMFILE
-	fi
-	interval=$XENBALLOON_INTERVAL
-	# do self-ballooning
-	selfballoon_eval
-	if [ $selfballoon_enabled = "true" ]; then
-		balloon_to_target 1
-		interval=$XENBALLOON_SELF_INTERVAL
-	# or do directed ballooning
-	elif [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/target ; then
-			tgtkb=`xenstore-read memory/target`
-			balloon_to_target $tgtkb
-		fi
-		interval=$XENBALLOON_INTERVAL
-	fi
-	shrink_preswap
-	send_memory_stats
-	send_preswap_stats
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/interval ; then
-			interval=`xenstore-read memory/interval`
-		fi
-	fi
-	sleep $interval
-done &
-
diff --git a/tools/xenballoon/xenballoond.README b/tools/xenballoon/xenballoond.README
deleted file mode 100644
index 9084898..0000000
--- a/tools/xenballoon/xenballoond.README
+++ /dev/null
@@ -1,85 +0,0 @@
-Xenballoond.README
-Preliminary version 0.1, 2008/06/30
-
-Copyright (C) 2008 Oracle Corporation and/or its affiliates.
-All rights reserved.
-Written by Dan Magenheimer <dan.magenheimer@oracle.com>
-
-INTRODUCTION
-
-Xenballoond runs in guest domains and both implements selfballooning and
-provides metrics to dom0 for (future) directed ballooning.  Both capabilities
-provide a foundation for basic "memory overcommit" functionality.
-
-With selfballooning enabled, xenballoond uses the Committed_AS value found
-in /proc/meminfo as a first approximation of how much memory is required
-by the guest and feeds this statistic back to the balloon driver to inflate
-or deflate the balloon as required to achieve the target guest memory size.
-Hysteresis parameters may be adjusted to rate-limit balloon inflation
-and deflation.
-
-If configured, certain selfballooning parameters -- including notably
-enabling/disabling of self-ballooning -- can be controlled from domain0.
-(These are fully documented in xenballoon.conf.)
-
-If configured, the following guest statistics are sent back to domain0:
-- /proc/meminfo
-- /proc/vmstat
-- /proc/uptime
-In a future release, some of these values will be used by a policy module
-in domain0 to control guest balloon size and provide memory balancing
-across all guests on a given system.
-
-Note that no page sharing (content-based or otherwise) is implemented
-and no VMM-based swapping is necessary.
-
-For more information, see:
-http://www.xen.org/files/xensummitboston08/MemoryOvercommit-XenSummit2008.pdf
-http://wiki.xensource.com/xenwiki/Open_Topics_For_Discussion?action=AttachFile&do=get&target=Memory+Overcommit.pdf
-
-INSTALLATION AND DEPLOYMENT
-
-In this preliminary release:
-- directed ballooning is not implemented, though a monitor is provided
-- only Redhat-based guests are supported
-
-Guest prerequisites to use xenballoond:
-- each guest must be configured with adequate[1] swap space
-- each guest must have the balloon driver installed (/proc/xen/balloon exists) 
-- if directed ballooning (or monitoring) is desired, xenstore tools must be
-  installed in each guest in /usr/bin [2]
-
-[1] for best results, for a guest that is configured with maxmem=N and
-    requires Z MB of swap space without xenballoond, available swap should
-    be increased to N+Z MB when xenballoond is running
-[2] specifically xenstore-read, xenstore-exists, and xenstore-write must
-    be installed.  Binaries can be obtained, for example, by building
-    xen-vvv.gz/tools in a guest-binary-compatible development tree
-
-Instructions to install/deploy xenballoond:
-  (see docs/misc/distro_mapping.txt for SYSCONFIG and INITD_DIR definitions)
-- in each guest:
-  - ensure pre-requisites are met (see above)
-  - place xenballoon.conf in <SYSCONFIG>
-  - place xenballoond in /usr/sbin
-  - copy xenballoond.init to <INITD_DIR>/xenballoond (note file rename)
-  - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that
-    selfballooning defaults as off)
-  - start xenballoond with "service xenballoond start", and/or configure
-    xenballoond to start at init
-        (Red Hat e.g. "chkconfig xenballoond on")
-        (Debian e.g. " update-rc.d xenballoond defaults")
-        (Suse e.g. " insserv xenballoond")
-- in domain0:
-  - if monitoring is desired, xenballoon-monitor may be installed in /usr/sbin
-- note that certain xenballoond.conf variables may be overridden by domain0
-  if xenstore is running in the guest; these are fully documented in
-  xenballoond.conf
-
-TODO:
-080630 domain0 ballooning policy module
-080630 experiment with more aggressive (optionally) memory minimum targets
-080630 BUG: xenballoond doesn't properly record the fact that it's running;
-       e.g. flipping between run levels 5 and 3 launches additional daemons
-080630 BUG: reports of possible incompatibilites between ballooning and
-       save/restore/migrate have not been duplicated
diff --git a/tools/xenballoon/xenballoond.init b/tools/xenballoon/xenballoond.init
deleted file mode 100644
index 5cd0fb3..0000000
--- a/tools/xenballoon/xenballoond.init
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/bash
-#
-# xenballoond	Script to start and stop Xen ballooning daemon.
-#
-# Copyright (C) 2009 Oracle Corporation and/or its affiliates.
-# All rights reserved.
-# Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
-#
-# chkconfig: 2345 98 01
-# description: Starts and stops the Xen ballooning daemon.
-### BEGIN INIT INFO
-# Provides:          xenballoond
-# Required-Start:    $syslog $remote_fs
-# Should-Start:
-# Required-Stop:     $syslog $remote_fs
-# Should-Stop:
-# Default-Start:     3 5
-# Default-Stop:      0 1 2 6
-# Short-Description: Start/stop xenballoond
-# Description:       Starts and stops the Xen ballooning daemon.
-### END INIT INFO
-
-# Source function library
-. /etc/init.d/functions
-
-#don't use in domain0
-[ -f /proc/xen/capabilities ] && \
-	grep -q "control_d" /proc/xen/capabilities && exit 0
-
-if [ -f /etc/sysconfig/xenballoon.conf ]; then
-	. /etc/sysconfig/xenballoon.conf
-elif [ -f /etc/default/xenballoon.conf ]; then
-	. /etc/default/xenballoon.conf
-fi
-
-# Check that balloon driver is present
-[ ! -f /proc/xen/balloon ] && exit 0
-
-# Record original memory (in kB)
-[ -z "$XENBALLOON_MAXMEMFILE" ] && exit 0
-let maxmem=`grep MemTotal /proc/meminfo | sed 's/  */ /' | cut -f2 -d' '`
-if [ -f "$XENBALLOON_MAXMEMFILE" ]; then
-	let oldmax=`cat $XENBALLOON_MAXMEMFILE`
-	if [ $oldmax -gt $maxmem ]; then
-		let maxmem=oldmax
-	fi
-fi
-echo $maxmem > $XENBALLOON_MAXMEMFILE
-
-RETVAL=0
-prog="xenballoond"
-
-start() {
-        # Start daemons.
-        echo -n $"Starting $prog: "
-        daemon xenballoond $OPTIONS
-	RETVAL=$?
-        echo
-	return $RETVAL
-}
-
-stop() {
-        echo -n $"Shutting down $prog: "
-	killproc xenballoond
-	RETVAL=$?
-        echo
-	return $RETVAL
-}
-
-# See how we were called.
-case "$1" in
-  start)
-	start
-        ;;
-  stop)
-	stop
-        ;;
-  status)
-	status xenballoond
-	RETVAL=$?
-	;;
-  restart|reload)
-	stop
-	start
-	RETVAL=$?
-	;;
-  *)
-        echo $"Usage: $0 {start|stop|restart|status}"
-        exit 1
-esac
-
-exit $RETVAL
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:57:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:57: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 1UiOu5-0003bb-SE; Fri, 31 May 2013 12:57:57 +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 1UiOu4-0003aG-Bd
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:56 +0000
Received: from [85.158.139.83:16308] by server-7.bemta-5.messagelabs.com id
	92/AD-12828-35E98A15; Fri, 31 May 2013 12:57:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1370005072!29967043!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20217 invoked from network); 31 May 2013 12:57:53 -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;
	31 May 2013 12:57: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 1UiOu0-0004GO-FP
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOu0-00053v-D8
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:52 +0000
Date: Fri, 31 May 2013 12:57:52 +0000
Message-Id: <E1UiOu0-00053v-D8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenballoond: remove as it is now
	obsolete + unsupported 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

commit 1adef1732f67b4039170210bb2e67c64c9dabd4c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Apr 22 13:14:16 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 10:02:04 2013 +0100

    xenballoond: remove as it is now obsolete + unsupported code
    
    Dan, the author, states:
    > this code is five years old, is distro dependent, and is now
    > completely unsupported.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/xenballoon/xenballoon-monitor |   59 -------
 tools/xenballoon/xenballoon.conf    |  136 -----------------
 tools/xenballoon/xenballoond        |  283 -----------------------------------
 tools/xenballoon/xenballoond.README |   85 -----------
 tools/xenballoon/xenballoond.init   |   92 -----------
 5 files changed, 0 insertions(+), 655 deletions(-)

diff --git a/tools/xenballoon/xenballoon-monitor b/tools/xenballoon/xenballoon-monitor
deleted file mode 100644
index c23cd39..0000000
--- a/tools/xenballoon/xenballoon-monitor
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-#
-# xenballoon-monitor - monitor certain stats from xenballoond
-#   (run in dom0 with "watch -d xenballoon-monitor" for xentop-like output)
-# updated 090610 to include tmem stats
-#
-# Copyright (C) 2009 Oracle Corporation and/or its affiliates.
-# All rights reserved
-# Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
-#
-# Hint: Use "xm sched-credit -d 0 -w 2000" to watch on heavily loaded machines
-#
-TMEMTMP=$(/bin/mktemp -q /tmp/xenballoon-monitor.XXXXXX)
-echo "id   mem-kb  tgt-kb  commit  swapin swapout    pgin    pgout  preswap  precache"
-for i in `xenstore-list /local/domain`; do
- if [ "$i" -ne 0 ]; then
- tot=0; tgt=0; sin=0; sout=0; pgin=0; pgout=0; cmt=0; up=0; idle=0;
- act=0; preswap=0; precache=0
- if xenstore-exists /local/domain/$i/memory/meminfo; then
-  tot=`xenstore-read /local/domain/$i/memory/meminfo | grep MemTotal \
-   | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'`
-  cmt=`xenstore-read /local/domain/$i/memory/meminfo | grep Committed_AS \
-   | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'`
- fi
- if xenstore-exists /local/domain/$i/memory/selftarget; then
-  tgt=`xenstore-read /local/domain/$i/memory/selftarget`
- fi
- if xenstore-exists /local/domain/$i/memory/vmstat; then
-  sin=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pswpin | cut -d" " -f2)
-  sout=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pswpout | cut -d" " -f2)
-  pgin=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pgpgin | cut -d" " -f2)
-  pgout=$(xenstore-read /local/domain/$i/memory/vmstat | tr '\\\n' '\n' \
-	| grep pgout | cut -d" " -f2)
- fi
- xm tmem-list --all --long > $TMEMTMP
- precache=`grep "C=CI:$i" $TMEMTMP | sed 's/C=CI.*Ec:\([0-9][0-9]*\).*/\1/'`
- if xenstore-exists /local/domain/$i/memory/preswap; then
-  preswap=`xenstore-read /local/domain/$i/memory/preswap`
-  printf "%2d %8d%8d%8d%7d%8d%9d%9d%9d%9d\n" $i $tot $tgt $cmt $sin $sout $pgin $pgout $preswap $precache
- else
-  printf "%2d %8d%8d%8d%9d%9d%10d%10d\n" $i $tot $tgt $cmt $sin $sout $pgin $pgout
- fi
- fi
-done
-echo -n Free memory: `xm info | grep free | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'` MiB "  "
-tmem_free_pages=`grep "G=" $TMEMTMP | sed 's/G=.*Ta:\([0-9][0-9]*\).*/\1/'`
-if [ ! -z "$tmem_free_pages" ]; then
- let "tmem_free_mb=$tmem_free_pages/256"
- echo -n Idle tmem: $tmem_free_mb MiB "  "
-fi
-tmem_eph_pages=`grep "G=" $TMEMTMP | sed 's/G=.*Ec:\([0-9][0-9]*\).*/\1/'`
-if [ ! -z "$tmem_eph_pages" ]; then
- let "tmem_eph_mb=$tmem_eph_pages/256"
- echo -n Ephemeral tmem: $tmem_eph_mb MiB
-fi
-echo ""
diff --git a/tools/xenballoon/xenballoon.conf b/tools/xenballoon/xenballoon.conf
deleted file mode 100644
index a1ca902..0000000
--- a/tools/xenballoon/xenballoon.conf
+++ /dev/null
@@ -1,136 +0,0 @@
-## Path: System/xen
-## Description: xen domain start/stop on boot
-## Type: string
-## Default: 
-
-# NOTE: "xenbus is enabled" means not only that /proc/xen/xenbus exists
-# but also that /usr/bin/xenstore-* tools are installed.
-
-## Type: boolean
-## Default: false
-#
-# If XENBALLOON_SELF is true, selfballooning will occur, meaning the
-# balloon driver will grow and shrink according to available memory.
-# If xenbus is enabled, may be overridden by {memory/selfballoon}==0
-# If false but xenballoond is able to communicate with domain0 via
-# xenbus, balloon targets will be set by domain0
-# 
-XENBALLOON_SELF=false
-
-## Type: integer (must be > 0)
-## Default: 1
-#
-# If self-ballooning, number of seconds between checks/adjustments.
-# If xenbus is enabled, may be overridden by {memory/interval}
-XENBALLOON_SELF_INTERVAL=1
-
-## Type: integer (must be > 0)
-## Default: 1
-#
-# If NOT self-ballooning but xenbus is enabled, number of seconds between
-# checks/adjustments. May be overridden by {memory/interval}
-XENBALLOON_INTERVAL=1
-
-## Type: integer (must be > 0)
-## Default: 10
-#
-# When current > target, reduces rate at which target memory is ballooned
-# out.  For a value of n, 1/n of the difference will be ballooned.
-# This value applies both to selfballooning and directed ballooning.
-# May be overridden by {memory/downhysteresis}
-XENBALLOON_AUTO_DOWNHYSTERESIS=10
-
-## Type: integer (must be > 0)
-## Default: 1
-#
-# When current < target, reduces rate at which target memory is reclaimed
-# (if available).  For a value of n, 1/n of the difference will be ballooned.
-# This value applies both to selfballooning and directed ballooning.
-# May be overridden by {memory/uphysteresis}
-XENBALLOON_AUTO_UPHYSTERESIS=1
-
-## Type: integer (must be >= 0)
-## Default: 0
-#
-# In order to avoid ballooning so much memory that a guest experiences
-# out-of-memory errors (OOMs), memory will not be ballooned out below
-# a minimum target, in MB.  If this value is 0 (default), an heuristic
-# based on the maximum amount of memory will be used.  (The heuristic
-# provides the same minimum as recent versions of the balloon driver but
-# early versions of the balloon driver did not enforce a minimum.)
-XENBALLOON_MINMEM=0
-
-## Type: string
-## Default: "/var/run/xenballoon-maxmem"
-#
-# Location where memory high-water mark is stored; if a guest supports
-# hot-add memory, maxmem might increase across time and the minimum
-# target heuristic is based on max memory. NOTE: Reboot after changing
-# this variable, else overballooning may occur.
-XENBALLOON_MAXMEMFILE=/var/run/xenballoon-maxmem
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the result of 'cat /proc/meminfo" on xenbus at memory/meminfo
-XENBALLOON_SEND_MEMINFO=1
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the result of 'cat /proc/vmstat" on xenbus at memory/vmstat
-XENBALLOON_SEND_VMSTAT=1
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the result of 'cat /proc/uptime" on xenbus at memory/uptime
-XENBALLOON_SEND_UPTIME=1
-
-## Type: boolean
-## Default: false
-#
-# If tmem is running, pages swapped to a swap disk may instead go
-# into preswap.  These pages may become stale (i.e. no longer need
-# to be saved because, e.g., the process owning them has gone away)
-# and stale pages use precious precious domain-allocated memory.
-# Periodically try to reduce preswap to squeeze out stale pages
-XENBALLOON_PRESWAP_SHRINK=false
-
-## Type: string
-## Default: "/proc/sys/vm/preswap"
-## (change to /sys/proc/vm/preswap in later kernels)
-#
-# If tmem and preswap are running, reading this file gives the number of
-# pages currently in preswap.  Writing it with N invokes the preswap_shrink
-# routine to reduce preswap to N pages.
-XENBALLOON_PRESWAP_SYSFILE=/proc/sys/vm/preswap
-
-## Type: integer (must be > 0)
-## Default: 20
-#
-# If tmem and preswap are running, attempts to reduce number of pages
-# currently in preswap.  For a value of n, 1/n of the pages will
-# be attempted to be shrunk.
-# If xenbus is enabled, may be overridden by {memory/preswaphysteresis}
-XENBALLOON_PRESWAP_HYSTERESIS=20
-
-## Type: integer (must be > 0)
-## Default: 10
-#
-# Number of ballooning intervals where preswap size remains at N pages
-# before preswap shrinking is attempted.  Also if shrinking fails to
-# shrink to the target, counter resets to this value.
-# If xenbus is enabled, may be overridden by {memory/preswapinertia}
-XENBALLOON_PRESWAP_INERTIA=10
-
-## Type: integer (0 or 1)
-## Default: 1
-#
-# If xenbus is enabled, whether selfballooning or directed ballooning,
-# place the size of preswap (in pages) on xenbus at memory/preswap
-XENBALLOON_SEND_PRESWAP=1
-
diff --git a/tools/xenballoon/xenballoond b/tools/xenballoon/xenballoond
deleted file mode 100644
index 121aa3e..0000000
--- a/tools/xenballoon/xenballoond
+++ /dev/null
@@ -1,283 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2008 Oracle Corporation and/or its affiliates.
-# All rights reserved.
-# Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
-#
-# xenballoond - In-guest engine for Xen memory ballooning
-# Original version: 080630
-# Updated 0906XX: add tmem preswap auto-shrinking
-#
-# Two self-ballooning "policies" are implemented:
-# - Selfballooning: Adjust memory periodically, with no (or little) input
-#     from domain0.  Target memory is determined solely by the
-#     Committed_AS line in /proc/meminfo, but parameters may adjust
-#     the rate at which the target is achieved.
-# - Directed ballooning: Adjust memory solely as directed by domain0
-#
-# Under some circumstances, "output" may also be generated; the contents
-# of /proc/meminfo and /proc/vmstat may be periodically placed on xenbus.
-#
-# If xenbus is running and the /usr/bin/xenstore-* tools are installed,
-# "xenbus is enabled".
-#
-# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although
-# some are not used with directed ballooning, all must be set properly.
-# If xenbus is enabled, some of these parameters may be overridden by values
-# set by domain0 via xenbus.
-
-minmb() {
-	RETVAL=$XENBALLOON_MINMEM
-	if [ $RETVAL -ne 0 ]; then
-		return $RETVAL
-	fi
-	kb=`cat $XENBALLOON_MAXMEMFILE`
-	let "mb=$kb/1024"
-	let "pages=$kb/4"
-	# this algorithm from drivers/xen/balloon/balloon.c:minimum_target()
-	# which was added to balloon.c in 2008 to avoid ballooning too small
-	# it is unnecessary here except to accomodate pre-2008 balloon drivers
-	# note that ranges are adjusted because a VM with "memory=1024"
-	# gets somewhat less than 1024MB
-	if [ $mb -lt 125 ]; then
-		let RETVAL="$(( 8 + ($pages >> 9) ))"
-	elif [ $mb -lt 500 ]; then
-		let RETVAL="$(( 40 + ($pages >> 10) ))"
-	elif [ $mb -lt 2000 ]; then
-		let RETVAL="$(( 104 + ($pages >> 11) ))"
-	else
-		let RETVAL="$(( 296 + ($pages >> 13) ))"
-	fi
-	return	# value returned in RETVAL in mB
-}
-
-curkb() {
-	kb=`grep MemTotal /proc/meminfo | sed 's/  */ /' | \
-		cut -f2 -d' '`
-	RETVAL=$kb
-	return  # value returned in RETVAL in kB
-}
-
-downhysteresis() {
-	RETVAL=$XENBALLOON_AUTO_DOWNHYSTERESIS
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/downhysteresis ; then
-			RETVAL=`xenstore-read memory/downhysteresis`
-		fi
-	fi
-	return
-}
-
-uphysteresis() {
-	RETVAL=$XENBALLOON_AUTO_UPHYSTERESIS
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/uphysteresis ; then
-			RETVAL=`xenstore-read memory/uphysteresis`
-		fi
-	fi
-	return
-}
-
-selfballoon_eval() {
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/selfballoon; then
-			RETVAL=`xenstore-read memory/selfballoon`
-			if [ $RETVAL -eq 1 ]; then
-				selfballoon_enabled=true
-				return
-			fi
-		fi
-	fi
-	selfballoon_enabled=$XENBALLOON_SELF
-	return
-}
-
-selftarget() {
-	tgtkb=`grep Committed_AS /proc/meminfo | sed 's/  */ /' | cut -f2 -d' '`
-	minmb
-	let "minbytes=$RETVAL*1024*1024"
-	let "tgtbytes=$tgtkb*1024"
-	if [ $tgtbytes -lt $minbytes ]; then
-		let "tgtbytes=$minbytes"
-	fi
-	RETVAL=$tgtbytes  # value returned in RETVAL in bytes
-	return
-}
-
-# $1 == 1 means use selftarget, else target in kB
-balloon_to_target() {
-	if [ "$1" -eq 1 ]; then
-		selftarget
-		tgtbytes=$RETVAL
-	else
-		let "tgtbytes=$(( $1 * 1024 ))"
-	fi
-	curkb
-	let "curbytes=$RETVAL*1024"
-	if [ $curbytes -gt $tgtbytes ]; then
-		downhysteresis
-		downhys=$RETVAL
-		if [ $downhys -ne 0 ]; then
-			let "tgtbytes=$(( $curbytes - \
-				( ( $curbytes - $tgtbytes ) / $downhys ) ))"
-		fi
-	else if [ $curbytes -lt $tgtbytes ]; then
-		uphysteresis
-		uphys=$RETVAL
-		let "tgtbytes=$(( $curbytes + \
-				( ( $tgtbytes - $curbytes ) / $uphys ) ))"
-		fi
-	fi
-	echo $tgtbytes > /proc/xen/balloon
-	if [ $xenstore_enabled = "true" ]; then
-		let "tgtkb=$(( $tgtbytes/1024 ))"
-		xenstore-write memory/selftarget $tgtkb
-	fi
-}
-
-send_memory_stats() {
-	if [ ! $xenstore_enabled = "true" ]; then
-		return
-	fi
-	if [ $XENBALLOON_SEND_MEMINFO ]; then
-		xenstore-write memory/meminfo "`cat /proc/meminfo`"
-	fi
-	if [ $XENBALLOON_SEND_VMSTAT ]; then
-		xenstore-write memory/vmstat "`cat /proc/vmstat`"
-	fi
-	if [ $XENBALLOON_SEND_UPTIME ]; then
-		xenstore-write memory/uptime "`cat /proc/uptime`"
-	fi
-}
-
-
-curpreswappages() {
-	pages=$(cat $XENBALLOON_PRESWAP_SYSFILE)
-	RETVAL=$pages
-	return  # value returned in RETVAL in pages
-}
-
-preswaphysteresis() {
-	RETVAL=$XENBALLOON_PRESWAP_HYSTERESIS
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/preswaphysteresis ; then
-			RETVAL=`xenstore-read memory/preswaphysteresis`
-		fi
-	fi
-	return
-}
-
-preswapinertia() {
-	RETVAL=$XENBALLOON_PRESWAP_INERTIA
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/preswapinertia ; then
-			RETVAL=`xenstore-read memory/preswapinertia`
-		fi
-	fi
-	return
-}
-
-send_preswap_stats() {
-	if [ ! $xenstore_enabled = "true" ]; then
-		return
-	fi
-	curpreswappages
-	preswap_pgs=$RETVAL
-	if [ $XENBALLOON_SEND_PRESWAP ]; then
-		xenstore-write memory/preswap "$preswap_pgs"
-	fi
-}
-
-shrink_preswap() {
-	if [ "$XENBALLOON_PRESWAP_SHRINK" = "false" ]; then
-		return
-	fi
-	if [ ! -f "$XENBALLOON_PRESWAP_SYSFILE" ]; then
-		return
-	fi
-	curpreswappages
-	preswaplast=$preswapnow
-	preswapnow=$RETVAL
-	if [ $preswapnow -eq 0 -o $preswapnow -ne $preswaplast ]; then
-		preswapinertia
-		preswapinertiacounter=$RETVAL
-		return
-	fi
-	let "preswapinertiacounter=$preswapinertiacounter-1"
-	if [ $preswapinertiacounter -ne 0 ]; then
-		return
-	fi
-	preswaphysteresis
-	preswaphys=$RETVAL
-	if [ $preswaphys -eq 0 ]; then
-		return
-	fi
-	let "tgtpreswappages=$(( $preswapnow - \
-				( $preswapnow / $preswaphys ) ))"
-	preswapinertia
-	preswapinertiacounter=$RETVAL
-	echo $tgtpreswappages > "$XENBALLOON_PRESWAP_SYSFILE"
-}
-
-if [ ! -f /proc/xen/balloon ]; then
-	echo "$0: no balloon driver installed"
-	exit 0
-fi
-if [ ! -f /proc/meminfo ]; then
-	echo "$0: can't read /proc/meminfo"
-	exit 0
-fi
-xenstore_enabled=true
-if [ -f /usr/bin/xenstore-exists -a -f /usr/bin/xenstore-read -a \
-     -f /usr/bin/xenstore-write ]; then
-	xenstore_enabled=true
-else
-	echo "$0: missing /usr/bin/xenstore-* tools, disabling directed ballooning"
-	xenstore_enabled=false
-fi
-preswapnow=0
-
-# See docs/misc/distro_mapping.txt
-if [ -f /etc/sysconfig/xenballoon.conf ]; then
-	. /etc/sysconfig/xenballoon.conf
-elif [ -f /etc/default/xenballoon.conf ]; then
-	. /etc/default/xenballoon.conf
-fi
-
-while true;
-do
-	# handle special case for PV domains with hot-add memory
-	if [ ! -f $XENBALLOON_MAXMEMFILE ]; then
-		maxkb=0
-	else
-		maxkb=`cat $XENBALLOON_MAXMEMFILE`
-	fi
-	curkb=`grep MemTotal /proc/meminfo | sed 's/  */ /' | cut -f2 -d' '`
-	if [ $curkb -gt $maxkb ]; then
-		echo $curkb > $XENBALLOON_MAXMEMFILE
-	fi
-	interval=$XENBALLOON_INTERVAL
-	# do self-ballooning
-	selfballoon_eval
-	if [ $selfballoon_enabled = "true" ]; then
-		balloon_to_target 1
-		interval=$XENBALLOON_SELF_INTERVAL
-	# or do directed ballooning
-	elif [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/target ; then
-			tgtkb=`xenstore-read memory/target`
-			balloon_to_target $tgtkb
-		fi
-		interval=$XENBALLOON_INTERVAL
-	fi
-	shrink_preswap
-	send_memory_stats
-	send_preswap_stats
-	if [ $xenstore_enabled = "true" ]; then
-		if xenstore-exists memory/interval ; then
-			interval=`xenstore-read memory/interval`
-		fi
-	fi
-	sleep $interval
-done &
-
diff --git a/tools/xenballoon/xenballoond.README b/tools/xenballoon/xenballoond.README
deleted file mode 100644
index 9084898..0000000
--- a/tools/xenballoon/xenballoond.README
+++ /dev/null
@@ -1,85 +0,0 @@
-Xenballoond.README
-Preliminary version 0.1, 2008/06/30
-
-Copyright (C) 2008 Oracle Corporation and/or its affiliates.
-All rights reserved.
-Written by Dan Magenheimer <dan.magenheimer@oracle.com>
-
-INTRODUCTION
-
-Xenballoond runs in guest domains and both implements selfballooning and
-provides metrics to dom0 for (future) directed ballooning.  Both capabilities
-provide a foundation for basic "memory overcommit" functionality.
-
-With selfballooning enabled, xenballoond uses the Committed_AS value found
-in /proc/meminfo as a first approximation of how much memory is required
-by the guest and feeds this statistic back to the balloon driver to inflate
-or deflate the balloon as required to achieve the target guest memory size.
-Hysteresis parameters may be adjusted to rate-limit balloon inflation
-and deflation.
-
-If configured, certain selfballooning parameters -- including notably
-enabling/disabling of self-ballooning -- can be controlled from domain0.
-(These are fully documented in xenballoon.conf.)
-
-If configured, the following guest statistics are sent back to domain0:
-- /proc/meminfo
-- /proc/vmstat
-- /proc/uptime
-In a future release, some of these values will be used by a policy module
-in domain0 to control guest balloon size and provide memory balancing
-across all guests on a given system.
-
-Note that no page sharing (content-based or otherwise) is implemented
-and no VMM-based swapping is necessary.
-
-For more information, see:
-http://www.xen.org/files/xensummitboston08/MemoryOvercommit-XenSummit2008.pdf
-http://wiki.xensource.com/xenwiki/Open_Topics_For_Discussion?action=AttachFile&do=get&target=Memory+Overcommit.pdf
-
-INSTALLATION AND DEPLOYMENT
-
-In this preliminary release:
-- directed ballooning is not implemented, though a monitor is provided
-- only Redhat-based guests are supported
-
-Guest prerequisites to use xenballoond:
-- each guest must be configured with adequate[1] swap space
-- each guest must have the balloon driver installed (/proc/xen/balloon exists) 
-- if directed ballooning (or monitoring) is desired, xenstore tools must be
-  installed in each guest in /usr/bin [2]
-
-[1] for best results, for a guest that is configured with maxmem=N and
-    requires Z MB of swap space without xenballoond, available swap should
-    be increased to N+Z MB when xenballoond is running
-[2] specifically xenstore-read, xenstore-exists, and xenstore-write must
-    be installed.  Binaries can be obtained, for example, by building
-    xen-vvv.gz/tools in a guest-binary-compatible development tree
-
-Instructions to install/deploy xenballoond:
-  (see docs/misc/distro_mapping.txt for SYSCONFIG and INITD_DIR definitions)
-- in each guest:
-  - ensure pre-requisites are met (see above)
-  - place xenballoon.conf in <SYSCONFIG>
-  - place xenballoond in /usr/sbin
-  - copy xenballoond.init to <INITD_DIR>/xenballoond (note file rename)
-  - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that
-    selfballooning defaults as off)
-  - start xenballoond with "service xenballoond start", and/or configure
-    xenballoond to start at init
-        (Red Hat e.g. "chkconfig xenballoond on")
-        (Debian e.g. " update-rc.d xenballoond defaults")
-        (Suse e.g. " insserv xenballoond")
-- in domain0:
-  - if monitoring is desired, xenballoon-monitor may be installed in /usr/sbin
-- note that certain xenballoond.conf variables may be overridden by domain0
-  if xenstore is running in the guest; these are fully documented in
-  xenballoond.conf
-
-TODO:
-080630 domain0 ballooning policy module
-080630 experiment with more aggressive (optionally) memory minimum targets
-080630 BUG: xenballoond doesn't properly record the fact that it's running;
-       e.g. flipping between run levels 5 and 3 launches additional daemons
-080630 BUG: reports of possible incompatibilites between ballooning and
-       save/restore/migrate have not been duplicated
diff --git a/tools/xenballoon/xenballoond.init b/tools/xenballoon/xenballoond.init
deleted file mode 100644
index 5cd0fb3..0000000
--- a/tools/xenballoon/xenballoond.init
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/bash
-#
-# xenballoond	Script to start and stop Xen ballooning daemon.
-#
-# Copyright (C) 2009 Oracle Corporation and/or its affiliates.
-# All rights reserved.
-# Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
-#
-# chkconfig: 2345 98 01
-# description: Starts and stops the Xen ballooning daemon.
-### BEGIN INIT INFO
-# Provides:          xenballoond
-# Required-Start:    $syslog $remote_fs
-# Should-Start:
-# Required-Stop:     $syslog $remote_fs
-# Should-Stop:
-# Default-Start:     3 5
-# Default-Stop:      0 1 2 6
-# Short-Description: Start/stop xenballoond
-# Description:       Starts and stops the Xen ballooning daemon.
-### END INIT INFO
-
-# Source function library
-. /etc/init.d/functions
-
-#don't use in domain0
-[ -f /proc/xen/capabilities ] && \
-	grep -q "control_d" /proc/xen/capabilities && exit 0
-
-if [ -f /etc/sysconfig/xenballoon.conf ]; then
-	. /etc/sysconfig/xenballoon.conf
-elif [ -f /etc/default/xenballoon.conf ]; then
-	. /etc/default/xenballoon.conf
-fi
-
-# Check that balloon driver is present
-[ ! -f /proc/xen/balloon ] && exit 0
-
-# Record original memory (in kB)
-[ -z "$XENBALLOON_MAXMEMFILE" ] && exit 0
-let maxmem=`grep MemTotal /proc/meminfo | sed 's/  */ /' | cut -f2 -d' '`
-if [ -f "$XENBALLOON_MAXMEMFILE" ]; then
-	let oldmax=`cat $XENBALLOON_MAXMEMFILE`
-	if [ $oldmax -gt $maxmem ]; then
-		let maxmem=oldmax
-	fi
-fi
-echo $maxmem > $XENBALLOON_MAXMEMFILE
-
-RETVAL=0
-prog="xenballoond"
-
-start() {
-        # Start daemons.
-        echo -n $"Starting $prog: "
-        daemon xenballoond $OPTIONS
-	RETVAL=$?
-        echo
-	return $RETVAL
-}
-
-stop() {
-        echo -n $"Shutting down $prog: "
-	killproc xenballoond
-	RETVAL=$?
-        echo
-	return $RETVAL
-}
-
-# See how we were called.
-case "$1" in
-  start)
-	start
-        ;;
-  stop)
-	stop
-        ;;
-  status)
-	status xenballoond
-	RETVAL=$?
-	;;
-  restart|reload)
-	stop
-	start
-	RETVAL=$?
-	;;
-  *)
-        echo $"Usage: $0 {start|stop|restart|status}"
-        exit 1
-esac
-
-exit $RETVAL
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:58:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:58: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 1UiOuF-0003gj-1o; Fri, 31 May 2013 12:58:07 +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 1UiOuD-0003gS-VV
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:58:06 +0000
Received: from [193.109.254.147:42089] by server-9.bemta-14.messagelabs.com id
	62/A1-15694-D5E98A15; Fri, 31 May 2013 12:58:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1370005082!2258317!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21126 invoked from network); 31 May 2013 12:58:04 -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;
	31 May 2013 12:58: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 1UiOuA-0004H5-KK
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:58:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOuA-00054I-JG
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:58:02 +0000
Date: Fri, 31 May 2013 12:58:02 +0000
Message-Id: <E1UiOuA-00054I-JG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: Fix after 54353cae096c "xen/arm:
	check string format for early_printk"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7476f4788250ef281e09b449753c7ddc19239c64
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu May 30 21:50:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 21:50:35 2013 +0100

    arm: Fix after 54353cae096c "xen/arm: check string format for early_printk"
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/early_printk.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index 03ead23..5f7c529 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -21,11 +21,12 @@ void early_panic(const char *fmt, ...) __attribute__((noreturn))
 
 #else
 
-static inline void early_printk(const char *fmt, ...)
-    __attribute__((format (printf, 1, 2)))
+static inline  __attribute__((format (printf, 1, 2))) void
+early_printk(const char *fmt, ...)
 {}
-static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...)
-    __attribute__((format (printf, 1, 2)))
+
+static inline void  __attribute__((noreturn))
+__attribute__((format (printf, 1, 2))) early_panic(const char *fmt, ...)
 {while(1);}
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:58:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:58: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 1UiOuF-0003gj-1o; Fri, 31 May 2013 12:58:07 +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 1UiOuD-0003gS-VV
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:58:06 +0000
Received: from [193.109.254.147:42089] by server-9.bemta-14.messagelabs.com id
	62/A1-15694-D5E98A15; Fri, 31 May 2013 12:58:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1370005082!2258317!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21126 invoked from network); 31 May 2013 12:58:04 -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;
	31 May 2013 12:58: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 1UiOuA-0004H5-KK
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:58:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOuA-00054I-JG
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:58:02 +0000
Date: Fri, 31 May 2013 12:58:02 +0000
Message-Id: <E1UiOuA-00054I-JG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: Fix after 54353cae096c "xen/arm:
	check string format for early_printk"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 7476f4788250ef281e09b449753c7ddc19239c64
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu May 30 21:50:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 21:50:35 2013 +0100

    arm: Fix after 54353cae096c "xen/arm: check string format for early_printk"
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/early_printk.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/include/asm-arm/early_printk.h b/xen/include/asm-arm/early_printk.h
index 03ead23..5f7c529 100644
--- a/xen/include/asm-arm/early_printk.h
+++ b/xen/include/asm-arm/early_printk.h
@@ -21,11 +21,12 @@ void early_panic(const char *fmt, ...) __attribute__((noreturn))
 
 #else
 
-static inline void early_printk(const char *fmt, ...)
-    __attribute__((format (printf, 1, 2)))
+static inline  __attribute__((format (printf, 1, 2))) void
+early_printk(const char *fmt, ...)
 {}
-static inline void  __attribute__((noreturn)) early_panic(const char *fmt, ...)
-    __attribute__((format (printf, 1, 2)))
+
+static inline void  __attribute__((noreturn))
+__attribute__((format (printf, 1, 2))) early_panic(const char *fmt, ...)
 {while(1);}
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:59:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:59: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 1UiOvG-0003r3-7i; Fri, 31 May 2013 12:59: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 1UiOvE-0003qh-6V
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:59:08 +0000
Received: from [193.109.254.147:24139] by server-11.bemta-14.messagelabs.com
	id B7/40-09099-B9E98A15; Fri, 31 May 2013 12:59:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1370005021!5112013!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18281 invoked from network); 31 May 2013 12:57:02 -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;
	31 May 2013 12:57:02 -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 1UiOtB-0004FM-HQ
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtB-00051B-F6
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:01 +0000
Date: Fri, 31 May 2013 12:57:01 +0000
Message-Id: <E1UiOtB-00051B-F6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gcov: Add script to split coverage
	informations.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cc1eca5194d2278c076d922ae439cf2bf4f88da6
Author:     Frediano Ziglio <frediano.ziglio@citrix.com>
AuthorDate: Thu May 23 13:55:18 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:30:18 2013 +0100

    gcov: Add script to split coverage informations.
    
    Split coverage informations extracted from xencov utility.
    This script accept coverage blob either as file or from input and extract
    into files compatible with gcc format (gcda).
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/misc/Makefile     |    2 +-
 tools/misc/xencov_split |  189 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 190 insertions(+), 1 deletions(-)

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index eef9411..520ef80 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -18,7 +18,7 @@ SUBDIRS-$(CONFIG_LOMOUNT) += lomount
 SUBDIRS-$(CONFIG_MINITERM) += miniterm
 SUBDIRS := $(SUBDIRS-y)
 
-INSTALL_BIN-y := xencons
+INSTALL_BIN-y := xencons xencov_split
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
diff --git a/tools/misc/xencov_split b/tools/misc/xencov_split
new file mode 100755
index 0000000..2e5aa80
--- /dev/null
+++ b/tools/misc/xencov_split
@@ -0,0 +1,189 @@
+#!/usr/bin/perl
+
+# xencov_split - split coverage information from Xen
+#
+# Copyright (C) 2013  - 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+use strict;
+use File::Path qw(mkpath);
+
+# some magic constants
+my $magic = 0x67636461;
+my $ctrBase = 0x01a10000;
+
+my $xenMagic = 0x58544346;	# file header
+my $xenTagFunc = 0x58544366;	# functions tag
+my $xenTagCount0 = 0x58544330;	# counter 0 tag
+my $xenTagEnd = 0x5854432e;	# end file
+
+# open input file
+if ($ARGV[0]) {
+	my $fn = $ARGV[0];
+	open(IN, '<', $fn) or die "opening file \"$fn\"";
+} else {
+	open(IN, '<&STDIN') or die "redirecting input";
+}
+
+my $pos = 0;
+
+sub getRaw($)
+{
+    my $l = shift;
+    die 'got no data to read' if $l < 0;
+    my $res = '';
+    do {
+        my $data;
+        my $r = read(IN, $data, $l);
+        die "error $! reading data from input at position $pos" if !defined($r);
+        die "unexpected end of file at position $pos" if !$r;
+        $l -= $r;
+        $pos += $r;
+        $res .= $data;
+    } while ($l > 0);
+    return $res;
+}
+
+sub get32()
+{
+    return unpack('V', getRaw(4));
+}
+
+sub get64()
+{
+    # This is returned as raw data as some Perl version could not
+    # support 64 bit integer
+    # This is ok for little endian machines
+    return getRaw(8);
+}
+
+sub align()
+{
+    my $l = $pos & 7;
+    getRaw(8-$l) if $l;
+}
+
+# read a string prefixed by length
+sub getS()
+{
+    my $l = get32();
+    my $res = getRaw($l);
+    align();
+    return $res;
+}
+
+sub parseFunctions($)
+{
+    my $numCounters = shift;
+    my $num = get32();
+
+    my @funcs;
+    for my $n (1..$num) {
+        my @data;
+        my $ident = get32();
+        my $checksum = get32();
+        for my $n (1..$numCounters) {
+            push @data, get32(); # number of counters for a type
+        }
+        push @funcs, [$ident, $checksum, \@data];
+    }
+    align();
+    return @funcs;
+}
+
+sub parseCounters($)
+{
+    my $tag = shift;
+    die sprintf("wrong tag 0x%08x pos $pos (0x%08x)", $tag, $pos) if $tag < $xenTagCount0;
+    $tag -= $xenTagCount0;
+    die sprintf('wrong tag 0x%08x', $tag) if $tag > 5;
+    my $data = '';
+
+    my $num = get32();
+    for my $n (1..$num) {
+        $data .= get64();
+    }
+    align();
+    return [$tag, $data];
+}
+
+
+sub parseFile()
+{
+    my $ver = get32();
+    my $stamp = get32();
+    my $fn = getS();
+    align();
+
+    my $numCounters;
+
+    print "got file $fn\n";
+    die if $fn !~ m,^(/.*?)[^/]+\.gcda$,;
+    mkpath(".$1");
+    open(OUT, '>', ".$fn") or die;
+
+    print OUT pack('VVV', $magic, $ver, $stamp);
+
+    # read counters of file
+    my @ctrs;
+    my @funcs;
+    my $tag;
+    for (;;) {
+        $tag = get32();
+        last if ($tag == $xenMagic || $tag == $xenTagEnd);
+        if ($tag == $xenTagFunc) {
+            die if scalar(@funcs);
+            @funcs = parseFunctions(scalar(@ctrs));
+            next;
+        }
+
+        # must be a counter
+        push @ctrs, parseCounters($tag);
+        ++$numCounters;
+    }
+
+    # print all functions
+    for my $f (@funcs) {
+        # tag tag_len ident checksum
+        print OUT pack('VVVV', 0x01000000, 2, $f->[0], $f->[1]);
+        # all counts
+        my $n = 0;
+        for my $c (@{$f->[2]}) {
+            my ($type, $data) = @{$ctrs[$n]};
+            print OUT pack('VV', $ctrBase + 0x20000 * $type, $c*2);
+            die "--$c--$type--$data--" if length($data) < $c * 8;
+            print OUT substr($data, 0, $c * 8);
+            $ctrs[$n] = [$type, substr($data, $c * 8)];
+            ++$n;
+        }
+    }
+    close(OUT);
+
+    return $tag;
+}
+
+my $tag = get32();
+die 'no coverage or wrong file format' if $tag != $xenMagic;
+for (;;) {
+    if ($tag == $xenMagic) {
+        $tag = parseFile();
+    } elsif ($tag == $xenTagEnd) {
+        last;
+    } else {
+        die "wrong tag $tag";
+    }
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 12:59:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 12:59: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 1UiOvG-0003r3-7i; Fri, 31 May 2013 12:59: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 1UiOvE-0003qh-6V
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:59:08 +0000
Received: from [193.109.254.147:24139] by server-11.bemta-14.messagelabs.com
	id B7/40-09099-B9E98A15; Fri, 31 May 2013 12:59:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1370005021!5112013!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18281 invoked from network); 31 May 2013 12:57:02 -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;
	31 May 2013 12:57:02 -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 1UiOtB-0004FM-HQ
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOtB-00051B-F6
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:57:01 +0000
Date: Fri, 31 May 2013 12:57:01 +0000
Message-Id: <E1UiOtB-00051B-F6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gcov: Add script to split coverage
	informations.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 cc1eca5194d2278c076d922ae439cf2bf4f88da6
Author:     Frediano Ziglio <frediano.ziglio@citrix.com>
AuthorDate: Thu May 23 13:55:18 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:30:18 2013 +0100

    gcov: Add script to split coverage informations.
    
    Split coverage informations extracted from xencov utility.
    This script accept coverage blob either as file or from input and extract
    into files compatible with gcc format (gcda).
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/misc/Makefile     |    2 +-
 tools/misc/xencov_split |  189 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 190 insertions(+), 1 deletions(-)

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index eef9411..520ef80 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -18,7 +18,7 @@ SUBDIRS-$(CONFIG_LOMOUNT) += lomount
 SUBDIRS-$(CONFIG_MINITERM) += miniterm
 SUBDIRS := $(SUBDIRS-y)
 
-INSTALL_BIN-y := xencons
+INSTALL_BIN-y := xencons xencov_split
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
diff --git a/tools/misc/xencov_split b/tools/misc/xencov_split
new file mode 100755
index 0000000..2e5aa80
--- /dev/null
+++ b/tools/misc/xencov_split
@@ -0,0 +1,189 @@
+#!/usr/bin/perl
+
+# xencov_split - split coverage information from Xen
+#
+# Copyright (C) 2013  - 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+use strict;
+use File::Path qw(mkpath);
+
+# some magic constants
+my $magic = 0x67636461;
+my $ctrBase = 0x01a10000;
+
+my $xenMagic = 0x58544346;	# file header
+my $xenTagFunc = 0x58544366;	# functions tag
+my $xenTagCount0 = 0x58544330;	# counter 0 tag
+my $xenTagEnd = 0x5854432e;	# end file
+
+# open input file
+if ($ARGV[0]) {
+	my $fn = $ARGV[0];
+	open(IN, '<', $fn) or die "opening file \"$fn\"";
+} else {
+	open(IN, '<&STDIN') or die "redirecting input";
+}
+
+my $pos = 0;
+
+sub getRaw($)
+{
+    my $l = shift;
+    die 'got no data to read' if $l < 0;
+    my $res = '';
+    do {
+        my $data;
+        my $r = read(IN, $data, $l);
+        die "error $! reading data from input at position $pos" if !defined($r);
+        die "unexpected end of file at position $pos" if !$r;
+        $l -= $r;
+        $pos += $r;
+        $res .= $data;
+    } while ($l > 0);
+    return $res;
+}
+
+sub get32()
+{
+    return unpack('V', getRaw(4));
+}
+
+sub get64()
+{
+    # This is returned as raw data as some Perl version could not
+    # support 64 bit integer
+    # This is ok for little endian machines
+    return getRaw(8);
+}
+
+sub align()
+{
+    my $l = $pos & 7;
+    getRaw(8-$l) if $l;
+}
+
+# read a string prefixed by length
+sub getS()
+{
+    my $l = get32();
+    my $res = getRaw($l);
+    align();
+    return $res;
+}
+
+sub parseFunctions($)
+{
+    my $numCounters = shift;
+    my $num = get32();
+
+    my @funcs;
+    for my $n (1..$num) {
+        my @data;
+        my $ident = get32();
+        my $checksum = get32();
+        for my $n (1..$numCounters) {
+            push @data, get32(); # number of counters for a type
+        }
+        push @funcs, [$ident, $checksum, \@data];
+    }
+    align();
+    return @funcs;
+}
+
+sub parseCounters($)
+{
+    my $tag = shift;
+    die sprintf("wrong tag 0x%08x pos $pos (0x%08x)", $tag, $pos) if $tag < $xenTagCount0;
+    $tag -= $xenTagCount0;
+    die sprintf('wrong tag 0x%08x', $tag) if $tag > 5;
+    my $data = '';
+
+    my $num = get32();
+    for my $n (1..$num) {
+        $data .= get64();
+    }
+    align();
+    return [$tag, $data];
+}
+
+
+sub parseFile()
+{
+    my $ver = get32();
+    my $stamp = get32();
+    my $fn = getS();
+    align();
+
+    my $numCounters;
+
+    print "got file $fn\n";
+    die if $fn !~ m,^(/.*?)[^/]+\.gcda$,;
+    mkpath(".$1");
+    open(OUT, '>', ".$fn") or die;
+
+    print OUT pack('VVV', $magic, $ver, $stamp);
+
+    # read counters of file
+    my @ctrs;
+    my @funcs;
+    my $tag;
+    for (;;) {
+        $tag = get32();
+        last if ($tag == $xenMagic || $tag == $xenTagEnd);
+        if ($tag == $xenTagFunc) {
+            die if scalar(@funcs);
+            @funcs = parseFunctions(scalar(@ctrs));
+            next;
+        }
+
+        # must be a counter
+        push @ctrs, parseCounters($tag);
+        ++$numCounters;
+    }
+
+    # print all functions
+    for my $f (@funcs) {
+        # tag tag_len ident checksum
+        print OUT pack('VVVV', 0x01000000, 2, $f->[0], $f->[1]);
+        # all counts
+        my $n = 0;
+        for my $c (@{$f->[2]}) {
+            my ($type, $data) = @{$ctrs[$n]};
+            print OUT pack('VV', $ctrBase + 0x20000 * $type, $c*2);
+            die "--$c--$type--$data--" if length($data) < $c * 8;
+            print OUT substr($data, 0, $c * 8);
+            $ctrs[$n] = [$type, substr($data, $c * 8)];
+            ++$n;
+        }
+    }
+    close(OUT);
+
+    return $tag;
+}
+
+my $tag = get32();
+die 'no coverage or wrong file format' if $tag != $xenMagic;
+for (;;) {
+    if ($tag == $xenMagic) {
+        $tag = parseFile();
+    } elsif ($tag == $xenTagEnd) {
+        last;
+    } else {
+        die "wrong tag $tag";
+    }
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 13:01:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 13:01: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 1UiOxY-00040H-FY; Fri, 31 May 2013 13:01: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 1UiOxX-00040C-2n
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 13:01:31 +0000
Received: from [85.158.138.51:56418] by server-8.bemta-3.messagelabs.com id
	9E/65-25864-A2F98A15; Fri, 31 May 2013 13:01:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1370005284!21362418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23088 invoked from network); 31 May 2013 13:01:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	31 May 2013 13:01: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 1UiOsW-0004Ev-Lt
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsW-0004yv-Jq
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:20 +0000
Date: Fri, 31 May 2013 12:56:20 +0000
Message-Id: <E1UiOsW-0004yv-Jq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: move UART base
	address to Rules.mk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 74025300d55262155a3bdafddf257d82dcf0f6af
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:28 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:33 2013 +0100

    arm/early-printk: move UART base address to Rules.mk
    
    The UART memory mapped base address is currently hardcoded in the
    early-printk UART driver, which denies the driver to be used by
    two machines with a different mapping.
    Move this definition out to xen/arch/arm/Rules.mk, allowing easier
    user access and later sharing of the driver.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt          |    2 +-
 xen/arch/arm/Rules.mk                   |    4 +++-
 xen/arch/arm/arm32/debug-exynos4210.inc |    2 --
 xen/arch/arm/arm32/debug-pl011.inc      |    2 --
 xen/arch/arm/arm64/debug-pl011.inc      |    2 --
 5 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 965add5..9220113 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -12,7 +12,7 @@ where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
 
-The baud rate is hardcoded in xen/arch/arm/Rules.mk,
+The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
 If not explicitly requested with "EARLY_PRINTK_INIT_UART := y" in Rules.mk,
 the code will not try to initialize the UART, so that bootloader or
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index fdcf73e..902bddb 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -42,15 +42,16 @@ EARLY_PRINTK := n
 ifeq ($(debug),y)
 
 # Early printk for versatile express
-# TODO handle UART base address from make command line
 ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
 EARLY_PRINTK_INC := pl011
 EARLY_PRINTK_BAUD := 38400
+EARLY_UART_BASE_ADDRESS := 0x1c090000
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
 EARLY_PRINTK_INIT_UART := y
 EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0x12c20000
 endif
 
 ifneq ($(EARLY_PRINTK_INC),)
@@ -61,4 +62,5 @@ CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
 CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS)
 endif
diff --git a/xen/arch/arm/arm32/debug-exynos4210.inc b/xen/arch/arm/arm32/debug-exynos4210.inc
index 4922148..d746c35 100644
--- a/xen/arch/arm/arm32/debug-exynos4210.inc
+++ b/xen/arch/arm/arm32/debug-exynos4210.inc
@@ -18,8 +18,6 @@
 
 #include <asm/exynos4210-uart.h>
 
-#define EARLY_UART_BASE_ADDRESS 0x12c20000
-
 /* Exynos 5 UART initialization
  * rb: register which contains the UART base address
  * rc: scratch register 1
diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc
index 2d970ea..8b085b8 100644
--- a/xen/arch/arm/arm32/debug-pl011.inc
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -16,8 +16,6 @@
  * GNU General Public License for more details.
  */
 
-#define EARLY_UART_BASE_ADDRESS 0x1c090000
-
 /* PL011 UART initialization
  * rb: register which contains the UART base address
  * rc: scratch register 1
diff --git a/xen/arch/arm/arm64/debug-pl011.inc b/xen/arch/arm/arm64/debug-pl011.inc
index 7220940..b416235 100644
--- a/xen/arch/arm/arm64/debug-pl011.inc
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -18,8 +18,6 @@
 
 #include <asm/asm_defns.h>
 
-#define EARLY_UART_BASE_ADDRESS 0x1c090000
-
 /* PL011 UART initialization
  * xb: register which containts the UART base address
  * c: scratch register number */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 13:01:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 13:01: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 1UiOxY-00040H-FY; Fri, 31 May 2013 13:01: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 1UiOxX-00040C-2n
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 13:01:31 +0000
Received: from [85.158.138.51:56418] by server-8.bemta-3.messagelabs.com id
	9E/65-25864-A2F98A15; Fri, 31 May 2013 13:01:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1370005284!21362418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23088 invoked from network); 31 May 2013 13:01:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	31 May 2013 13:01: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 1UiOsW-0004Ev-Lt
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiOsW-0004yv-Jq
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 12:56:20 +0000
Date: Fri, 31 May 2013 12:56:20 +0000
Message-Id: <E1UiOsW-0004yv-Jq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm/early-printk: move UART base
	address to Rules.mk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 74025300d55262155a3bdafddf257d82dcf0f6af
Author:     Andre Przywara <andre.przywara@calxeda.com>
AuthorDate: Fri May 24 15:47:28 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu May 30 09:20:33 2013 +0100

    arm/early-printk: move UART base address to Rules.mk
    
    The UART memory mapped base address is currently hardcoded in the
    early-printk UART driver, which denies the driver to be used by
    two machines with a different mapping.
    Move this definition out to xen/arch/arm/Rules.mk, allowing easier
    user access and later sharing of the driver.
    
    Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/arm/early-printk.txt          |    2 +-
 xen/arch/arm/Rules.mk                   |    4 +++-
 xen/arch/arm/arm32/debug-exynos4210.inc |    2 --
 xen/arch/arm/arm32/debug-pl011.inc      |    2 --
 xen/arch/arm/arm64/debug-pl011.inc      |    2 --
 5 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 965add5..9220113 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -12,7 +12,7 @@ where mach is the name of the machine:
   - vexpress: printk with pl011 for versatile express
   - exynos5250: printk with the second UART
 
-The baud rate is hardcoded in xen/arch/arm/Rules.mk,
+The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
 If not explicitly requested with "EARLY_PRINTK_INIT_UART := y" in Rules.mk,
 the code will not try to initialize the UART, so that bootloader or
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index fdcf73e..902bddb 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -42,15 +42,16 @@ EARLY_PRINTK := n
 ifeq ($(debug),y)
 
 # Early printk for versatile express
-# TODO handle UART base address from make command line
 ifeq ($(CONFIG_EARLY_PRINTK), vexpress)
 EARLY_PRINTK_INC := pl011
 EARLY_PRINTK_BAUD := 38400
+EARLY_UART_BASE_ADDRESS := 0x1c090000
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
 EARLY_PRINTK_INIT_UART := y
 EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0x12c20000
 endif
 
 ifneq ($(EARLY_PRINTK_INC),)
@@ -61,4 +62,5 @@ CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
 CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
+CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS)
 endif
diff --git a/xen/arch/arm/arm32/debug-exynos4210.inc b/xen/arch/arm/arm32/debug-exynos4210.inc
index 4922148..d746c35 100644
--- a/xen/arch/arm/arm32/debug-exynos4210.inc
+++ b/xen/arch/arm/arm32/debug-exynos4210.inc
@@ -18,8 +18,6 @@
 
 #include <asm/exynos4210-uart.h>
 
-#define EARLY_UART_BASE_ADDRESS 0x12c20000
-
 /* Exynos 5 UART initialization
  * rb: register which contains the UART base address
  * rc: scratch register 1
diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc
index 2d970ea..8b085b8 100644
--- a/xen/arch/arm/arm32/debug-pl011.inc
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -16,8 +16,6 @@
  * GNU General Public License for more details.
  */
 
-#define EARLY_UART_BASE_ADDRESS 0x1c090000
-
 /* PL011 UART initialization
  * rb: register which contains the UART base address
  * rc: scratch register 1
diff --git a/xen/arch/arm/arm64/debug-pl011.inc b/xen/arch/arm/arm64/debug-pl011.inc
index 7220940..b416235 100644
--- a/xen/arch/arm/arm64/debug-pl011.inc
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -18,8 +18,6 @@
 
 #include <asm/asm_defns.h>
 
-#define EARLY_UART_BASE_ADDRESS 0x1c090000
-
 /* PL011 UART initialization
  * xb: register which containts the UART base address
  * c: scratch register number */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri May 31 18:44:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 18:44: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 1UiUJ7-0007Fk-Rp; Fri, 31 May 2013 18:44:09 +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 1UiUJ6-0007Fb-IH
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:08 +0000
Received: from [85.158.139.211:51589] by server-9.bemta-5.messagelabs.com id
	31/38-14875-77FE8A15; Fri, 31 May 2013 18:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1370025846!19202851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25311 invoked from network); 31 May 2013 18:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 May 2013 18: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 1UiUJ0-0008Tt-Ts
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiUJ0-00056b-Nc
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:02 +0000
Date: Fri, 31 May 2013 18:44:02 +0000
Message-Id: <E1UiUJ0-00056b-Nc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix boot time APIC mode
	detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 857e2b43715ba86ee660924cfe1d772fa052c54d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 31 12:23:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:23:30 2013 +0200

    x86: fix boot time APIC mode detection
    
    current_cpu_data becomes valid only relatively late in the boot
    process, so looking there for a particular feature early in the game
    would generally give the appearance of the feature being unavailable.
    
    Getting this wrong means that at kexec time the system would get
    returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
    the APIC page, which on systems with x2APIC pre-enabled will never get
    set up.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 234c4dde2fd4f1182fe1a6bea6bced83fe363007
    master date: 2013-05-23 13:08:32 +0200
---
 xen/arch/x86/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 50430d2..00b25f0 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1473,7 +1473,7 @@ enum apic_mode current_local_apic_mode(void)
 
     /* Reading EXTD bit from the MSR is only valid if CPUID
      * says so, else reserved */
-    if ( cpu_has(&current_cpu_data, X86_FEATURE_X2APIC)
+    if ( boot_cpu_has(X86_FEATURE_X2APIC)
          && (msr_contents & MSR_IA32_APICBASE_EXTD) )
         return APIC_MODE_X2APIC;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 31 18:44:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 18:44: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 1UiUJ7-0007Fk-Rp; Fri, 31 May 2013 18:44:09 +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 1UiUJ6-0007Fb-IH
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:08 +0000
Received: from [85.158.139.211:51589] by server-9.bemta-5.messagelabs.com id
	31/38-14875-77FE8A15; Fri, 31 May 2013 18:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1370025846!19202851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25311 invoked from network); 31 May 2013 18:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 May 2013 18: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 1UiUJ0-0008Tt-Ts
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiUJ0-00056b-Nc
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:02 +0000
Date: Fri, 31 May 2013 18:44:02 +0000
Message-Id: <E1UiUJ0-00056b-Nc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix boot time APIC mode
	detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 857e2b43715ba86ee660924cfe1d772fa052c54d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 31 12:23:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:23:30 2013 +0200

    x86: fix boot time APIC mode detection
    
    current_cpu_data becomes valid only relatively late in the boot
    process, so looking there for a particular feature early in the game
    would generally give the appearance of the feature being unavailable.
    
    Getting this wrong means that at kexec time the system would get
    returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
    the APIC page, which on systems with x2APIC pre-enabled will never get
    set up.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 234c4dde2fd4f1182fe1a6bea6bced83fe363007
    master date: 2013-05-23 13:08:32 +0200
---
 xen/arch/x86/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 50430d2..00b25f0 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1473,7 +1473,7 @@ enum apic_mode current_local_apic_mode(void)
 
     /* Reading EXTD bit from the MSR is only valid if CPUID
      * says so, else reserved */
-    if ( cpu_has(&current_cpu_data, X86_FEATURE_X2APIC)
+    if ( boot_cpu_has(X86_FEATURE_X2APIC)
          && (msr_contents & MSR_IA32_APICBASE_EXTD) )
         return APIC_MODE_X2APIC;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 31 18:44:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 18:44: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 1UiUJI-0007Gl-Uv; Fri, 31 May 2013 18:44:20 +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 1UiUJH-0007GV-5q
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:19 +0000
Received: from [85.158.139.83:27179] by server-13.bemta-5.messagelabs.com id
	9B/7C-08040-28FE8A15; Fri, 31 May 2013 18:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1370025856!20687698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8850 invoked from network); 31 May 2013 18:44:17 -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;
	31 May 2013 18: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 1UiUJE-0008Tw-9g
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiUJE-00056z-2X
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:16 +0000
Date: Fri, 31 May 2013 18:44:16 +0000
Message-Id: <E1UiUJE-00056z-2X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxc: limit cpu values when
	setting vcpu affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 34e2c78baa7eff6369595adc7e51e70a4a0c8727
Author:     Petr Matousek <pmatouse@redhat.com>
AuthorDate: Fri May 31 12:24:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:24:18 2013 +0200

    libxc: limit cpu values when setting vcpu affinity
    
    When support for pinning more than 64 cpus was added, check for cpu
    out-of-range values was removed. This can lead to subsequent
    out-of-bounds cpumap array accesses in case the cpu number is higher
    than the actual count.
    
    This patch returns the check.
    
    This is CVE-2013-2072 / XSA-56
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
    master commit: 41abbadef60e5fccdfd688579dd458f7f7887cf5
    master date: 2013-05-29 15:49:22 +0100
---
 tools/python/xen/lowlevel/xc/xc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 7c89756..540de61 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -228,6 +228,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
     int vcpu = 0, i;
     xc_cpumap_t cpumap;
     PyObject *cpulist = NULL;
+    int nr_cpus;
 
     static char *kwd_list[] = { "domid", "vcpu", "cpumap", NULL };
 
@@ -235,6 +236,10 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
                                       &dom, &vcpu, &cpulist) )
         return NULL;
 
+    nr_cpus = xc_get_max_cpus(self->xc_handle);
+    if ( nr_cpus == 0 )
+        return pyxc_error_to_exception(self->xc_handle);
+
     cpumap = xc_cpumap_alloc(self->xc_handle);
     if(cpumap == NULL)
         return pyxc_error_to_exception(self->xc_handle);
@@ -244,6 +249,13 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         for ( i = 0; i < PyList_Size(cpulist); i++ ) 
         {
             long cpu = PyInt_AsLong(PyList_GetItem(cpulist, i));
+            if ( cpu < 0 || cpu >= nr_cpus )
+            {
+                free(cpumap);
+                errno = EINVAL;
+                PyErr_SetFromErrno(xc_error_obj);
+                return NULL;
+            }
             cpumap[cpu / 8] |= 1 << (cpu % 8);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 31 18:44:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 18:44: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 1UiUJI-0007Gl-Uv; Fri, 31 May 2013 18:44:20 +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 1UiUJH-0007GV-5q
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:19 +0000
Received: from [85.158.139.83:27179] by server-13.bemta-5.messagelabs.com id
	9B/7C-08040-28FE8A15; Fri, 31 May 2013 18:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1370025856!20687698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8850 invoked from network); 31 May 2013 18:44:17 -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;
	31 May 2013 18: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 1UiUJE-0008Tw-9g
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiUJE-00056z-2X
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 18:44:16 +0000
Date: Fri, 31 May 2013 18:44:16 +0000
Message-Id: <E1UiUJE-00056z-2X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxc: limit cpu values when
	setting vcpu affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 34e2c78baa7eff6369595adc7e51e70a4a0c8727
Author:     Petr Matousek <pmatouse@redhat.com>
AuthorDate: Fri May 31 12:24:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:24:18 2013 +0200

    libxc: limit cpu values when setting vcpu affinity
    
    When support for pinning more than 64 cpus was added, check for cpu
    out-of-range values was removed. This can lead to subsequent
    out-of-bounds cpumap array accesses in case the cpu number is higher
    than the actual count.
    
    This patch returns the check.
    
    This is CVE-2013-2072 / XSA-56
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
    master commit: 41abbadef60e5fccdfd688579dd458f7f7887cf5
    master date: 2013-05-29 15:49:22 +0100
---
 tools/python/xen/lowlevel/xc/xc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 7c89756..540de61 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -228,6 +228,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
     int vcpu = 0, i;
     xc_cpumap_t cpumap;
     PyObject *cpulist = NULL;
+    int nr_cpus;
 
     static char *kwd_list[] = { "domid", "vcpu", "cpumap", NULL };
 
@@ -235,6 +236,10 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
                                       &dom, &vcpu, &cpulist) )
         return NULL;
 
+    nr_cpus = xc_get_max_cpus(self->xc_handle);
+    if ( nr_cpus == 0 )
+        return pyxc_error_to_exception(self->xc_handle);
+
     cpumap = xc_cpumap_alloc(self->xc_handle);
     if(cpumap == NULL)
         return pyxc_error_to_exception(self->xc_handle);
@@ -244,6 +249,13 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         for ( i = 0; i < PyList_Size(cpulist); i++ ) 
         {
             long cpu = PyInt_AsLong(PyList_GetItem(cpulist, i));
+            if ( cpu < 0 || cpu >= nr_cpus )
+            {
+                free(cpumap);
+                errno = EINVAL;
+                PyErr_SetFromErrno(xc_error_obj);
+                return NULL;
+            }
             cpumap[cpu / 8] |= 1 << (cpu % 8);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri May 31 20:44:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 20:44: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 1UiWBJ-0001vc-2B; Fri, 31 May 2013 20:44:13 +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 1UiWBG-0001vX-TR
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:11 +0000
Received: from [193.109.254.147:23172] by server-1.bemta-14.messagelabs.com id
	63/35-06919-A9B09A15; Fri, 31 May 2013 20:44:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1370033046!4156438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5735 invoked from network); 31 May 2013 20:44:07 -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;
	31 May 2013 20: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 1UiWB9-0001Uu-Q5
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiWB8-0007ud-M8
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:02 +0000
Date: Fri, 31 May 2013 20:44:02 +0000
Message-Id: <E1UiWB8-0007ud-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: fix boot time APIC mode
	detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 360d23bfb87588809719ecd3c319f8b514034a04
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 31 12:27:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:27:52 2013 +0200

    x86: fix boot time APIC mode detection
    
    current_cpu_data becomes valid only relatively late in the boot
    process, so looking there for a particular feature early in the game
    would generally give the appearance of the feature being unavailable.
    
    Getting this wrong means that at kexec time the system would get
    returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
    the APIC page, which on systems with x2APIC pre-enabled will never get
    set up.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 234c4dde2fd4f1182fe1a6bea6bced83fe363007
    master date: 2013-05-23 13:08:32 +0200
---
 xen/arch/x86/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 2845d23..903a9ce 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1565,7 +1565,7 @@ enum apic_mode current_local_apic_mode(void)
 
     /* Reading EXTD bit from the MSR is only valid if CPUID
      * says so, else reserved */
-    if ( cpu_has(&current_cpu_data, X86_FEATURE_X2APIC)
+    if ( boot_cpu_has(X86_FEATURE_X2APIC)
          && (msr_contents & MSR_IA32_APICBASE_EXTD) )
         return APIC_MODE_X2APIC;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 31 20:44:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 20:44: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 1UiWBJ-0001vc-2B; Fri, 31 May 2013 20:44:13 +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 1UiWBG-0001vX-TR
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:11 +0000
Received: from [193.109.254.147:23172] by server-1.bemta-14.messagelabs.com id
	63/35-06919-A9B09A15; Fri, 31 May 2013 20:44:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1370033046!4156438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5735 invoked from network); 31 May 2013 20:44:07 -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;
	31 May 2013 20: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 1UiWB9-0001Uu-Q5
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiWB8-0007ud-M8
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:02 +0000
Date: Fri, 31 May 2013 20:44:02 +0000
Message-Id: <E1UiWB8-0007ud-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: fix boot time APIC mode
	detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 360d23bfb87588809719ecd3c319f8b514034a04
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 31 12:27:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:27:52 2013 +0200

    x86: fix boot time APIC mode detection
    
    current_cpu_data becomes valid only relatively late in the boot
    process, so looking there for a particular feature early in the game
    would generally give the appearance of the feature being unavailable.
    
    Getting this wrong means that at kexec time the system would get
    returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
    the APIC page, which on systems with x2APIC pre-enabled will never get
    set up.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 234c4dde2fd4f1182fe1a6bea6bced83fe363007
    master date: 2013-05-23 13:08:32 +0200
---
 xen/arch/x86/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 2845d23..903a9ce 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1565,7 +1565,7 @@ enum apic_mode current_local_apic_mode(void)
 
     /* Reading EXTD bit from the MSR is only valid if CPUID
      * says so, else reserved */
-    if ( cpu_has(&current_cpu_data, X86_FEATURE_X2APIC)
+    if ( boot_cpu_has(X86_FEATURE_X2APIC)
          && (msr_contents & MSR_IA32_APICBASE_EXTD) )
         return APIC_MODE_X2APIC;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 31 20:44:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 20:44: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 1UiWBR-0001wA-5K; Fri, 31 May 2013 20:44: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 1UiWBP-0001vn-74
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:19 +0000
Received: from [85.158.139.211:57989] by server-1.bemta-5.messagelabs.com id
	1F/7E-01720-1AB09A15; Fri, 31 May 2013 20:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1370033055!20495610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13020 invoked from network); 31 May 2013 20:44:16 -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;
	31 May 2013 20:44: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 1UiWBL-0001Ux-9Y
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiWBL-0007v1-7H
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:15 +0000
Date: Fri, 31 May 2013 20:44:15 +0000
Message-Id: <E1UiWBL-0007v1-7H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] libxc: limit cpu values when
	setting vcpu affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8dd9cde5d454e4cee55d0202abfd52ceeff1cd94
Author:     Petr Matousek <pmatouse@redhat.com>
AuthorDate: Fri May 31 12:28:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:28:18 2013 +0200

    libxc: limit cpu values when setting vcpu affinity
    
    When support for pinning more than 64 cpus was added, check for cpu
    out-of-range values was removed. This can lead to subsequent
    out-of-bounds cpumap array accesses in case the cpu number is higher
    than the actual count.
    
    This patch returns the check.
    
    This is CVE-2013-2072 / XSA-56
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
    master commit: 41abbadef60e5fccdfd688579dd458f7f7887cf5
    master date: 2013-05-29 15:49:22 +0100
---
 tools/python/xen/lowlevel/xc/xc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 2600b90..1c4ac93 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -228,6 +228,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
     int vcpu = 0, i;
     xc_cpumap_t cpumap;
     PyObject *cpulist = NULL;
+    int nr_cpus;
 
     static char *kwd_list[] = { "domid", "vcpu", "cpumap", NULL };
 
@@ -235,6 +236,10 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
                                       &dom, &vcpu, &cpulist) )
         return NULL;
 
+    nr_cpus = xc_get_max_cpus(self->xc_handle);
+    if ( nr_cpus == 0 )
+        return pyxc_error_to_exception(self->xc_handle);
+
     cpumap = xc_cpumap_alloc(self->xc_handle);
     if(cpumap == NULL)
         return pyxc_error_to_exception(self->xc_handle);
@@ -244,6 +249,13 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         for ( i = 0; i < PyList_Size(cpulist); i++ ) 
         {
             long cpu = PyInt_AsLong(PyList_GetItem(cpulist, i));
+            if ( cpu < 0 || cpu >= nr_cpus )
+            {
+                free(cpumap);
+                errno = EINVAL;
+                PyErr_SetFromErrno(xc_error_obj);
+                return NULL;
+            }
             cpumap[cpu / 8] |= 1 << (cpu % 8);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri May 31 20:44:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 May 2013 20:44: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 1UiWBR-0001wA-5K; Fri, 31 May 2013 20:44: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 1UiWBP-0001vn-74
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:19 +0000
Received: from [85.158.139.211:57989] by server-1.bemta-5.messagelabs.com id
	1F/7E-01720-1AB09A15; Fri, 31 May 2013 20:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1370033055!20495610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.6; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13020 invoked from network); 31 May 2013 20:44:16 -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;
	31 May 2013 20:44: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 1UiWBL-0001Ux-9Y
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UiWBL-0007v1-7H
	for xen-changelog@lists.xensource.com; Fri, 31 May 2013 20:44:15 +0000
Date: Fri, 31 May 2013 20:44:15 +0000
Message-Id: <E1UiWBL-0007v1-7H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] libxc: limit cpu values when
	setting vcpu affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: 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 8dd9cde5d454e4cee55d0202abfd52ceeff1cd94
Author:     Petr Matousek <pmatouse@redhat.com>
AuthorDate: Fri May 31 12:28:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 31 12:28:18 2013 +0200

    libxc: limit cpu values when setting vcpu affinity
    
    When support for pinning more than 64 cpus was added, check for cpu
    out-of-range values was removed. This can lead to subsequent
    out-of-bounds cpumap array accesses in case the cpu number is higher
    than the actual count.
    
    This patch returns the check.
    
    This is CVE-2013-2072 / XSA-56
    
    Signed-off-by: Petr Matousek <pmatouse@redhat.com>
    master commit: 41abbadef60e5fccdfd688579dd458f7f7887cf5
    master date: 2013-05-29 15:49:22 +0100
---
 tools/python/xen/lowlevel/xc/xc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 2600b90..1c4ac93 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -228,6 +228,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
     int vcpu = 0, i;
     xc_cpumap_t cpumap;
     PyObject *cpulist = NULL;
+    int nr_cpus;
 
     static char *kwd_list[] = { "domid", "vcpu", "cpumap", NULL };
 
@@ -235,6 +236,10 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
                                       &dom, &vcpu, &cpulist) )
         return NULL;
 
+    nr_cpus = xc_get_max_cpus(self->xc_handle);
+    if ( nr_cpus == 0 )
+        return pyxc_error_to_exception(self->xc_handle);
+
     cpumap = xc_cpumap_alloc(self->xc_handle);
     if(cpumap == NULL)
         return pyxc_error_to_exception(self->xc_handle);
@@ -244,6 +249,13 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         for ( i = 0; i < PyList_Size(cpulist); i++ ) 
         {
             long cpu = PyInt_AsLong(PyList_GetItem(cpulist, i));
+            if ( cpu < 0 || cpu >= nr_cpus )
+            {
+                free(cpumap);
+                errno = EINVAL;
+                PyErr_SetFromErrno(xc_error_obj);
+                return NULL;
+            }
             cpumap[cpu / 8] |= 1 << (cpu % 8);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

